From 10019bf985c3bd105f657118d3b35acec01fe316 Mon Sep 17 00:00:00 2001 From: woogerboy21 Date: Sat, 11 Jul 2015 15:41:59 -0400 Subject: [PATCH] Cleanup Added -u options by request. Removed line for running log cleanup prior to backup. Added abort warning. --- servatrice/scripts/db_backup_all | 9 ++++++--- servatrice/scripts/db_restore_all | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/servatrice/scripts/db_backup_all b/servatrice/scripts/db_backup_all index 42d329d2..ce3433ab 100644 --- a/servatrice/scripts/db_backup_all +++ b/servatrice/scripts/db_backup_all @@ -1,4 +1,5 @@ #!/bin/bash +set -u SLEEPTIME=5 SQLCONFFILE="./mysql.cnf" #set this to the path that contains the mysql.cnf file LOGAPPENDDATE=`date +%m%d%Y` @@ -25,11 +26,11 @@ TABLES=( "cockatrice_servers" "cockatrice_news" "cockatrice_rooms" - "cockatrice_rooms_gametypes" + "cockatrice_rooms_gametypes" ) -/home/wwadmin/scripts/db_maint_logs + PROCESSNAME="mysqldump" -#COMMANDRESULTS=`ps -e |grep $PROCESSNAME |grep -v grep` +COMMANDRESULTS=`ps -e |grep $PROCESSNAME |grep -v grep` if [ -z "$COMMANDRESULTS" ]; then [ ! -d $BACKUPDIR ] && mkdir -p $BACKUPDIR/ @@ -41,4 +42,6 @@ then sleep $SLEEPTIME done rm -rf "$ROOTFOLDER/$EXPIRATION/" +else + echo "Backup in progress, aborting" fi diff --git a/servatrice/scripts/db_restore_all b/servatrice/scripts/db_restore_all index e1d1c354..7dcb4527 100644 --- a/servatrice/scripts/db_restore_all +++ b/servatrice/scripts/db_restore_all @@ -1,4 +1,5 @@ #!/bin/bash +set -u SLEEPTIME=5 SQLCONFFILE="./mysql.cnf" #set this to the path that contains the mysql.cnf file LOGAPPENDDATE=`date +%m%d%Y` @@ -25,11 +26,11 @@ TABLES=( "cockatrice_servers" "cockatrice_news" "cockatrice_rooms" - "cockatrice_rooms_gametypes" + "cockatrice_rooms_gametypes" ) -/home/wwadmin/scripts/db_maint_logs + PROCESSNAME="mysqldump" -#COMMANDRESULTS=`ps -e |grep $PROCESSNAME |grep -v grep` +COMMANDRESULTS=`ps -e |grep $PROCESSNAME |grep -v grep` if [ -z "$COMMANDRESULTS" ]; then [ ! -d $BACKUPDIR ] && mkdir -p $BACKUPDIR/ @@ -47,4 +48,6 @@ then fi done rm -rf "$ROOTFOLDER/$EXPIRATION/" +else + echo "Restore in progress, aborting" fi