File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ case "$1" in
2727
2828 logMsg " Starting MySQL backup..."
2929 MYSQL_ROOT_PASSWORD=$( dockerExecMySQL printenv MYSQL_ROOT_PASSWORD)
30- dockerExecMySQL mysqldump -h mysql -u root -p " ${MYSQL_ROOT_PASSWORD} " -- opt --single-transaction --events --all-databases --routines --comments | bzip2 > " ${BACKUP_DIR} /${BACKUP_MYSQL_FILE} "
30+ dockerExecMySQL sh -c " MYSQL_PWD= \" ${MYSQL_ROOT_PASSWORD} \" mysqldump -h mysql -uroot -- opt --single-transaction --events --all-databases --routines --comments" | bzip2 > " ${BACKUP_DIR} /${BACKUP_MYSQL_FILE} "
3131 logMsg " Finished"
3232 else
3333 echo " * Skipping mysql backup, no such container"
Original file line number Diff line number Diff line change @@ -23,8 +23,8 @@ case "$1" in
2323 if [ -f " ${BACKUP_DIR} /${BACKUP_MYSQL_FILE} " ]; then
2424 logMsg " Starting MySQL restore..."
2525 MYSQL_ROOT_PASSWORD=$( dockerExecMySQL printenv MYSQL_ROOT_PASSWORD)
26- bzcat " ${BACKUP_DIR} /${BACKUP_MYSQL_FILE} " | dockerExecMySQL mysql -h mysql -u root -p " ${MYSQL_ROOT_PASSWORD} "
27- echo " FLUSH PRIVILEGES;" | dockerExec mysql -h mysql -u root -p " ${MYSQL_ROOT_PASSWORD} "
26+ bzcat " ${BACKUP_DIR} /${BACKUP_MYSQL_FILE} " | dockerExecMySQL sh -c " MYSQL_PWD= \" ${MYSQL_ROOT_PASSWORD} \" mysql -h mysql -uroot "
27+ echo " FLUSH PRIVILEGES;" | dockerExec sh -c " MYSQL_PWD= \" ${MYSQL_ROOT_PASSWORD} \" mysql -h mysql -uroot "
2828 logMsg " Finished"
2929 else
3030 errorMsg " MySQL backup file not found"
You can’t perform that action at this time.
0 commit comments