Add .env backup system to crontab and create integration guide

- Added daily .env backup at 02:00 with proper logging
- Added weekly .env validation at 08:30 on Sundays
- Created comprehensive integration guide
- Integrated with existing crontab management system
- Follows established logging pattern with syslog tags
This commit is contained in:
Peter Wood
2025-05-29 07:08:55 -04:00
parent d711e66fc8
commit 20737f7872
2 changed files with 139 additions and 0 deletions

View File

@@ -7,6 +7,10 @@
# Logs both stdout and stderr with backup-move tag
0 1 * * * /home/acedanger/shell/move-backups.sh 2>&1 | logger -t backup-move -p user.info
# Daily .env files backup at 0200 with logging
# Backs up all Docker .env files to private Gitea repository
0 2 * * * { 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
# Daily Plex database integrity check every 30 minutes
*/30 * * * * { echo "Check Plex database corruption"; /home/acedanger/shell/plex/backup-plex.sh --check-integrity --auto-repair; } 2>&1 | logger -t plex-database-integrity-check -p user.info
@@ -29,6 +33,10 @@
# Comprehensive reporting with system logging
0 8 * * 0 { echo "Starting weekly Plex backup report generation"; /home/acedanger/shell/plex/validate-plex-backups.sh --report; echo "Weekly report generation completed with exit code: $?"; } 2>&1 | logger -t plex-report -p user.info
# Weekly .env backup validation (Sundays at 0830)
# Validates 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 cron jobs (every 6 hours)
# This can help detect if any of the backup processes are failing
# 0 */6 * * * { echo "Cron health check - all backup jobs scheduled"; ps aux | grep -E "(backup-plex|validate-plex|move-backups)" | grep -v grep | wc -l; } 2>&1 | logger -t cron-health -p user.info