Update mysqlbu-scripts.sh

This commit is contained in:
2025-09-12 17:55:36 -05:00
parent 348bea3fb4
commit 27dc8e25ab

View File

@@ -228,8 +228,8 @@ case $1 in
if [ "${BACKUP_TYPE}" == "xtrabackup" ] || [ "${BACKUP_TYPE}" == "both" ]; then
[ "$BASE_BACKUP" = "" ] && $0 backup-base || $0 backup-incremental
fi
if [ "${BACKUP_TYPE}" == "mysqldump" ] || [ "${BACKUP_TYPE}" == "both" ]; then
/usr/local/bin/mysqlbu mysqldump
if [ "${BACKUP_TYPE}" == "mariadbdump" ] || [ "${BACKUP_TYPE}" == "mysqldump" ] || [ "${BACKUP_TYPE}" == "both" ]; then
/usr/local/bin/mysqlbu mariadbdump
fi
# LATEST_BACKUP="`ls -1t $DAY_BACKUP_DIR | grep --max-count=1 --perl-regexp '^.+-'`"
@@ -300,10 +300,12 @@ case $1 in
if [ ! -z ${BACKUP_HOST_PORT+x} ]; then BACKUPHOSTPORT="--port=${BACKUP_HOST_PORT}"; else BACKUPHOSTPORT=""; fi
DATABASES=$(/usr/bin/mariadb -u ${MYSQLUSER} --password="${MYSQLPASS}" -e "SHOW DATABASES;" | tr -d "| " | grep -v Database)
/bin/mariadb --execute "SET GLOBAL wsrep_desync = ON;"
for db in $DATABASES; do
FILE="${DEST_DIR}/$db.sql.gz"
/usr/bin/mariadb-dump --single-transaction --routines --quick -u ${MYSQLUSER} --password="${MYSQLPASS}" -B $db | gzip > "$FILE"
/bin/mariadb-dump --single-transaction --routines --master-data --quick -u ${MYSQLUSER} --password="${MYSQLPASS}" -B $db | gzip > "$FILE"
done
/bin/mariadb --execute "SET GLOBAL wsrep_desync = OFF;"
;;
'restore')