summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xmysql-backup.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/mysql-backup.sh b/mysql-backup.sh
index 97799de..ce42a89 100755
--- a/mysql-backup.sh
+++ b/mysql-backup.sh
@@ -5,16 +5,16 @@ BK_DIR="$HOME/MySQL/mysql-backup-$DC"
##mysqldump -A --opt --add-drop-database --order-by-primary --hex-blob |gzip -9 > mysql-backup-$DC.sql.gz
-[ -d $BK_DIR ] || mkdir -p $BK_DIR
-cd $BK_DIR
+[ -d "$BK_DIR" ] || mkdir -p "$BK_DIR"
+cd $BK_DIR || exit 1
for TBL in $( mysql -e 'show databases;' |cat ) ; do
echo "Backing up $TBL"
- /usr/bin/mysqldump --opt --add-drop-database --order-by-primary --hex-blob $TBL > $BK_DIR/$TBL.sql
+ /usr/bin/mysqldump --opt --add-drop-database --order-by-primary --hex-blob "$TBL" > "$BK_DIR/$TBL.sql"
done
cd $BK_DIR/..
echo "Archiving to mysql-backup-$DC"
-zip -9myroq $BK_DIR mysql-backup-$DC
+zip -9myroq "$BK_DIR" "mysql-backup-$DC"
#EOF