forked from ISTI-ansible-roles/ansible-roles
library/roles/mysql/files/mysql-backup.sh: Fix the script.
This commit is contained in:
parent
9e2fd102b0
commit
2ca9adc7ad
|
@ -30,7 +30,7 @@ fi
|
||||||
if [ ! -d $MY_BACKUP_DIR/history ] ; then
|
if [ ! -d $MY_BACKUP_DIR/history ] ; then
|
||||||
mkdir -p $MY_BACKUP_DIR/history
|
mkdir -p $MY_BACKUP_DIR/history
|
||||||
fi
|
fi
|
||||||
chmod -R 700 $MY_BACKUP_DIR
|
chmod 700 $MY_BACKUP_DIR
|
||||||
LOCKFILE=$MY_DATA_DIR/.mysqldump.lock
|
LOCKFILE=$MY_DATA_DIR/.mysqldump.lock
|
||||||
NAGIOS_LOG=$MY_BACKUP_DIR/.nagios-status
|
NAGIOS_LOG=$MY_BACKUP_DIR/.nagios-status
|
||||||
# Exclude list
|
# Exclude list
|
||||||
|
@ -43,9 +43,6 @@ if [ ! -f $LOCKFILE ] ; then
|
||||||
fi
|
fi
|
||||||
for db in $( /bin/ls -1 /var/lib/mysql/ | grep -v $EXCLUDE_LIST ) ; do
|
for db in $( /bin/ls -1 /var/lib/mysql/ | grep -v $EXCLUDE_LIST ) ; do
|
||||||
if [ -d /var/lib/mysql/$db ] ; then
|
if [ -d /var/lib/mysql/$db ] ; then
|
||||||
if [ -f $MY_BACKUP_DIR/$db.sql ] ; then
|
|
||||||
mv -f $MY_BACKUP_DIR/$db.sql $MY_BACKUP_DIR/history
|
|
||||||
fi
|
|
||||||
#mysqldump -uroot -f --opt -p$MYSQLPASS $db > $MY_BACKUP_DIR/$db.sql 2> $MY_BACKUP_DIR/log/$db.log
|
#mysqldump -uroot -f --opt -p$MYSQLPASS $db > $MY_BACKUP_DIR/$db.sql 2> $MY_BACKUP_DIR/log/$db.log
|
||||||
mysqldump -f --opt $db > $MY_BACKUP_DIR/history/${db}.sql.${SAVE_TIME} 2> $MY_BACKUP_LOG_DIR/$db.log
|
mysqldump -f --opt $db > $MY_BACKUP_DIR/history/${db}.sql.${SAVE_TIME} 2> $MY_BACKUP_LOG_DIR/$db.log
|
||||||
DUMP_RESULT=$?
|
DUMP_RESULT=$?
|
||||||
|
|
Loading…
Reference in New Issue