Version the backup with the date.

pull/39/head
Cédric Bonhomme 2017-08-07 12:15:03 +02:00
parent 5fd8e43cdc
commit 809de38e57
No known key found for this signature in database
GPG Key ID: A1CB94DE57B7A70D
1 changed files with 6 additions and 3 deletions

View File

@ -118,10 +118,13 @@ fi
if [[ $bypass -eq 0 ]]; then if [[ $bypass -eq 0 ]]; then
if [ -e data/dbcredentials/credentialsmysql.cnf ]; then if [ -e data/dbcredentials/credentialsmysql.cnf ]; then
echo "Dumping database to data/backup" echo "Dumping database to data/backup"
mysqldump --defaults-file=data/dbcredentials/credentialsmysql.cnf --databases monarc_common > data/backup/dump-common.sql mkdir data/backup/
mysqldump --defaults-file=data/dbcredentials/credentialsmysql.cnf --databases monarc_cli > data/backup/dbdump/dump-cli.sql 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 else
echo "Database dump not configured. Skipping." echo "Database backup not configured. Skipping."
fi fi
migrate_module $phpcommand $pathCore migrate_module $phpcommand $pathCore