mirror of
https://github.com/teddysun/across.git
synced 2025-01-19 06:19:35 +08:00
update
This commit is contained in:
parent
c1da0b7595
commit
42fc873ff5
@ -92,7 +92,7 @@ if [ -z ${MYSQL_ROOT_PASSWORD} ]; then
|
|||||||
log "MySQL root password not set, MySQL back up skip"
|
log "MySQL root password not set, MySQL back up skip"
|
||||||
else
|
else
|
||||||
log "MySQL dump start"
|
log "MySQL dump start"
|
||||||
mysql -u root -p"${MYSQL_ROOT_PASSWORD}" <<EOF
|
mysql -u root -p"${MYSQL_ROOT_PASSWORD}" 2>/dev/null <<EOF
|
||||||
exit
|
exit
|
||||||
EOF
|
EOF
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
@ -101,7 +101,7 @@ EOF
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${MYSQL_DATABASE_NAME[*]}" == "" ]; then
|
if [ "${MYSQL_DATABASE_NAME[*]}" == "" ]; then
|
||||||
mysqldump -u root -p"${MYSQL_ROOT_PASSWORD}" --all-databases > "${SQLFILE}"
|
mysqldump -u root -p"${MYSQL_ROOT_PASSWORD}" --all-databases > "${SQLFILE}" 2>/dev/null
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
log "MySQL all databases backup failed"
|
log "MySQL all databases backup failed"
|
||||||
exit 1
|
exit 1
|
||||||
@ -114,7 +114,7 @@ EOF
|
|||||||
do
|
do
|
||||||
unset DBFILE
|
unset DBFILE
|
||||||
DBFILE="${TEMPDIR}${db}_${BACKUPDATE}.sql"
|
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
|
if [ $? -ne 0 ]; then
|
||||||
log "MySQL database name [${db}] backup failed, please check database name is correct and try again"
|
log "MySQL database name [${db}] backup failed, please check database name is correct and try again"
|
||||||
exit 1
|
exit 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user