Commit 10019bf9 authored by woogerboy21's avatar woogerboy21
Browse files

Cleanup

Added -u options by request.
Removed line for running log cleanup prior to backup.
Added abort warning.
parent 04c09647
#!/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
#!/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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment