From 42fc873ff5913f8d093761c222ad4885c1ea94f8 Mon Sep 17 00:00:00 2001 From: Teddysun Date: Sun, 4 Sep 2016 13:52:01 +0900 Subject: [PATCH] update --- backup.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backup.sh b/backup.sh index 536f534..b4bd909 100644 --- a/backup.sh +++ b/backup.sh @@ -92,7 +92,7 @@ if [ -z ${MYSQL_ROOT_PASSWORD} ]; then log "MySQL root password not set, MySQL back up skip" else log "MySQL dump start" - mysql -u root -p"${MYSQL_ROOT_PASSWORD}" </dev/null < "${SQLFILE}" + mysqldump -u root -p"${MYSQL_ROOT_PASSWORD}" --all-databases > "${SQLFILE}" 2>/dev/null if [ $? -ne 0 ]; then log "MySQL all databases backup failed" exit 1 @@ -114,7 +114,7 @@ EOF do unset DBFILE DBFILE="${TEMPDIR}${db}_${BACKUPDATE}.sql" - mysqldump -u root -p"${MYSQL_ROOT_PASSWORD}" ${db} > "${DBFILE}" + mysqldump -u root -p"${MYSQL_ROOT_PASSWORD}" ${db} > "${DBFILE}" 2>/dev/null if [ $? -ne 0 ]; then log "MySQL database name [${db}] backup failed, please check database name is correct and try again" exit 1