Update mysqlbu-scripts.sh

This commit is contained in:
2023-07-01 20:45:43 -05:00
parent f02b66c428
commit 598b169219

View File

@@ -18,6 +18,7 @@ fi
MYSQLDATA="`grep --perl-regexp --only-match '(?<=datadir=).+' "$MYSQLCFG"`"
DAY_BACKUP_DIR="${BACKUP_PATH}/`date +%Y-%m-%d`/"
[ ! -d $DAY_BACKUP_DIR ] && mkdir -p $DAY_BACKUP_DIR
BASE_BACKUP="`ls -1 $DAY_BACKUP_DIR 2> /dev/null | grep --max-count=1 --perl-regexp '^.+_BASE'`"
LATEST_BACKUP="`ls -1t $DAY_BACKUP_DIR | grep --max-count=1 --perl-regexp '^.+-'`"
@@ -193,7 +194,7 @@ DELETE_MENU() {
case $1 in
'backup')
if [ "$BACKUP_ServerName" != "" ]; then
# if [ "$BACKUP_ServerName" != "" ]; then
echo "$(date) - Checking for mounted Backup Drive..."
if [ ! -f ${BACKUP_PATH}/mounted ]; then
echo "$(date) - Not found, mounting drive now..."
@@ -217,7 +218,7 @@ case $1 in
echo "$(date) - Backup Drive already mounted"
fi
fi
# fi
if [ "${BACKUP_TYPE}" == "xtrabackup" ] || [ "${BACKUP_TYPE}" == "both" ]; then
[ "$BASE_BACKUP" = "" ] && $0 backup-base || $0 backup-incremental