debate/scripts/cron/postgres-backup
Mikkel Georgsen 09f89617e7 feat(01-04): create PostgreSQL backup script with 30-day retention
- 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
2026-01-25 20:19:17 +00:00

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