From 809de38e5778e4ae43df387336d1927b03a6ba59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Bonhomme?= Date: Mon, 7 Aug 2017 12:15:03 +0200 Subject: [PATCH] Version the backup with the date. --- scripts/update-all.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/update-all.sh b/scripts/update-all.sh index ebd6f4a..9c96f5e 100755 --- a/scripts/update-all.sh +++ b/scripts/update-all.sh @@ -118,10 +118,13 @@ fi if [[ $bypass -eq 0 ]]; then if [ -e data/dbcredentials/credentialsmysql.cnf ]; then echo "Dumping database to data/backup" - mysqldump --defaults-file=data/dbcredentials/credentialsmysql.cnf --databases monarc_common > data/backup/dump-common.sql - mysqldump --defaults-file=data/dbcredentials/credentialsmysql.cnf --databases monarc_cli > data/backup/dbdump/dump-cli.sql + mkdir data/backup/ + backupdir=data/backup/$(date +"%Y%m%d_%H%M%S") + mkdir $backupdir + mysqldump --defaults-file=data/dbcredentials/credentialsmysql.cnf --databases monarc_common > $backupdir/dump-common.sql + mysqldump --defaults-file=data/dbcredentials/credentialsmysql.cnf --databases monarc_cli > $backupdir/dump-cli.sql else - echo "Database dump not configured. Skipping." + echo "Database backup not configured. Skipping." fi migrate_module $phpcommand $pathCore