Merge playerbot backup support from modules branch

- Add automatic detection of acore_playerbots database in all backup scripts
- Improve restore script with better error handling
- Add logging of databases being backed up
- Include test-backup-detection.sh script
This commit is contained in:
uprightbass360
2025-10-11 02:09:46 -04:00
parent ed1251d0df
commit 7b256e7571
5 changed files with 99 additions and 6 deletions

View File

@@ -10,9 +10,18 @@ BACKUP_DIR="/backups"
RETENTION_DAYS=${BACKUP_RETENTION_DAYS:-7}
DATE_FORMAT="%Y%m%d_%H%M%S"
# Database names
# Database names - core databases
DATABASES=("acore_auth" "acore_world" "acore_characters")
# Check if acore_playerbots database exists and add it to backup list
echo "Checking for optional acore_playerbots database..."
if mysql -h$MYSQL_HOST -P$MYSQL_PORT -u$MYSQL_USER -p$MYSQL_PASSWORD -e "USE acore_playerbots;" 2>/dev/null; then
DATABASES+=("acore_playerbots")
echo "✅ acore_playerbots database found - will be included in backup"
else
echo " acore_playerbots database not found - skipping (this is normal for some installations)"
fi
# Create backup directory
mkdir -p $BACKUP_DIR
@@ -22,6 +31,7 @@ BACKUP_SUBDIR="$BACKUP_DIR/$TIMESTAMP"
mkdir -p $BACKUP_SUBDIR
echo "[$TIMESTAMP] Starting AzerothCore database backup..."
echo "[$TIMESTAMP] Databases to backup: ${DATABASES[@]}"
# Backup each database
for db in "${DATABASES[@]}"; do