mirror of
https://github.com/acedanger/shell.git
synced 2025-12-06 05:40:11 -08:00
refactor: Improve backup-env-files.sh for temp file handling and enhance crontab entries for .env backups
This commit is contained in:
@@ -9,6 +9,14 @@
|
||||
# Daily system backup at 0400 with auto-cleanup
|
||||
0 4 * * * /home/acedanger/shell/crontab/crontab-backup-system.sh backup auto --auto-cleanup 2>&1 | logger -t crontab-backup -p user.info
|
||||
|
||||
# Daily .env files backup at 0300 with enhanced logging
|
||||
# Backs up Docker container .env files to Git repository
|
||||
0 3 * * * { echo "Starting .env files backup"; /home/acedanger/shell/backup-env-files.sh; echo ".env backup completed with exit code: $?"; } 2>&1 | logger -t env-backup -p user.info
|
||||
|
||||
# Weekly .env backup validation at 0830 on Sundays
|
||||
# Validates the integrity of .env backup repository
|
||||
30 8 * * 0 { echo "Starting .env backup validation"; /home/acedanger/shell/validate-env-backups.sh; echo ".env validation completed with exit code: $?"; } 2>&1 | logger -t env-validation -p user.info
|
||||
|
||||
# Optional: Add a health check entry to monitor backup jobs (every 6 hours)
|
||||
# This can help detect if the backup process is failing
|
||||
# 0 */6 * * * { echo "Cron health check - Docker backup job scheduled"; ps aux | grep "backup-docker" | grep -v grep | wc -l; } 2>&1 | logger -t cron-health -p user.info
|
||||
|
||||
Reference in New Issue
Block a user