46 |
MYSQL_DB=wc3ft; |
MYSQL_DB=wc3ft; |
47 |
##### Don't change anything below here ##### |
##### Don't change anything below here ##### |
48 |
|
|
49 |
EVENODD=$[ `date +%j` % 2 ]; |
# Without the "-" in "+%-j", date zero pads the number and bash treats it as octal. |
50 |
|
EVENODD=$[ `date +%-j` % 2 ]; |
51 |
|
|
52 |
# Remove files in directory we are about to use, or create it. |
# Remove files in directory we are about to use, or create it. |
53 |
if [ -d /$BACKUP_PATH/$EVENODD/ ]; then |
if [ -d /$BACKUP_PATH/$EVENODD/ ]; then |
54 |
rm -rf $BACKUP_PATH/$EVENODD/* |
rm -rf $BACKUP_PATH/$EVENODD/* |
55 |
else |
else |
56 |
mkdir $BACKUP_PATH/$EVENODD |
mkdir $BACKUP_PATH/$EVENODD || { echo 'hlds_backup failed to create backup directory!' >&2; exit 1; } |
|
# TODO: If this fails, exit script.. |
|
57 |
fi |
fi |
58 |
|
|
59 |
/etc/init.d/hlds stop |
/etc/init.d/hlds stop |