Automation: Final robust DB restore fixes and updated gitignore rules.
This commit is contained in:
20
scripts/backup_internal.sh
Normal file
20
scripts/backup_internal.sh
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
# Aether Internal Backup Script (Runs inside the Cron Container)
|
||||
set -e
|
||||
|
||||
# These are paths INSIDE the cron container
|
||||
BACKUP_DIR="/backups"
|
||||
TIMESTAMP=$(date +%Y%m%d_%H%M)
|
||||
BACKUP_FILE="${BACKUP_DIR}/auto_backup_${TIMESTAMP}.gz"
|
||||
|
||||
echo "[$(date)] Starting Scheduled Backup..."
|
||||
|
||||
# We use the Docker CLI inside this container to talk to the MariaDB container
|
||||
# The password is taken from the environment variable passed to this service
|
||||
docker exec ${CONTAINER_MARIADB} mariabackup --user=root --password="${AE_DB_PASSWORD}" \
|
||||
--backup --stream=xbstream --open-files-limit=65535 | gzip > "${BACKUP_FILE}"
|
||||
|
||||
echo "[$(date)] Backup Complete: ${BACKUP_FILE}"
|
||||
|
||||
# Optional: Clean up backups older than 7 days
|
||||
find "${BACKUP_DIR}" -name "auto_backup_*.gz" -mtime +7 -delete
|
||||
Reference in New Issue
Block a user