mirror of
https://github.com/uprightbass360/AzerothCore-RealmMaster.git
synced 2026-01-21 20:46:23 +00:00
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:
@@ -10,9 +10,18 @@ BACKUP_DIR="/backups"
|
||||
RETENTION_HOURS=${BACKUP_RETENTION_HOURS:-6}
|
||||
DATE_FORMAT="%Y%m%d_%H%M%S"
|
||||
|
||||
# Database names from environment variables
|
||||
# Database names from environment variables - core databases
|
||||
DATABASES=("${DB_AUTH_NAME:-acore_auth}" "${DB_WORLD_NAME:-acore_world}" "${DB_CHARACTERS_NAME:-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 hourly backup directory
|
||||
HOURLY_DIR="$BACKUP_DIR/hourly"
|
||||
mkdir -p $HOURLY_DIR
|
||||
@@ -23,6 +32,7 @@ BACKUP_SUBDIR="$HOURLY_DIR/$TIMESTAMP"
|
||||
mkdir -p $BACKUP_SUBDIR
|
||||
|
||||
echo "[$TIMESTAMP] Starting AzerothCore hourly backup..."
|
||||
echo "[$TIMESTAMP] Databases to backup: ${DATABASES[@]}"
|
||||
|
||||
# Backup each database
|
||||
for db in "${DATABASES[@]}"; do
|
||||
|
||||
Reference in New Issue
Block a user