diff --git a/backup_mysql.sh b/backup_mysql.sh index 45e7992..90b2822 100644 --- a/backup_mysql.sh +++ b/backup_mysql.sh @@ -4,7 +4,7 @@ set -o pipefail PATH="$PATH:/usr/local/bin:/usr/local/sbin" -SCRIPT_LOG=/var/log/backups_mysql.log +SCRIPT_LOG=/var/log/backup_mysql.log DB_USER="" @@ -68,12 +68,14 @@ function READ_DBS() DB_LIST=$(mysql -N --host=${DB_HOST} --user=${DB_USER} --password=${DB_PASSWORD} -e "$sql") &> /dev/null if [ $? -ne 0 ]; then LOG "ERROR: Getting list of databases failed." + DELETE_TMP_FOLDER exit 2 else if [[ -n $DB_LIST ]]; then LOG "SUCCESS: Getting list of databases success." else LOG "ERROR: List of databases is empty." + DELETE_TMP_FOLDER exit 2 fi fi