- Add backup-postgres.sh with pg_dump custom format (-Fc) - Verify backup integrity via pg_restore --list - Compress backups with gzip for storage efficiency - Delete backups older than 30 days (configurable via RETENTION_DAYS) - Weekly restore test on Mondays to validate backup usability - Add cron configuration for daily 2 AM backups - Add .gitignore for pycache, env files, and backup files
5 lines
277 B
Text
5 lines
277 B
Text
# PostgreSQL daily backup at 2 AM
|
|
# Install: sudo cp scripts/cron/postgres-backup /etc/cron.d/debate-postgres-backup
|
|
# Requires: /var/log/debate directory to exist
|
|
|
|
0 2 * * * root /home/mikkel/repos/debate/scripts/backup-postgres.sh >> /var/log/debate/postgres-backup.log 2>&1
|