Add database backup/restore script with auto-pruning
scripts/db-backup.sh provides three commands: - backup: creates a timestamped, gzipped pg_dump (custom format) in ./backups/ - restore: drops, recreates, and loads a backup with confirmation prompt - list: shows available backups with sizes and dates Supports --keep N flag for automatic pruning of backups older than N days, making it cron-friendly for daily automated backups. Also adds backups/ and *.dump.gz to .gitignore. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
5
.gitignore
vendored
5
.gitignore
vendored
@@ -24,6 +24,11 @@ postgres_data/
|
||||
redis_data/
|
||||
pgdata/
|
||||
|
||||
# Database backups
|
||||
backups/
|
||||
*.dump
|
||||
*.dump.gz
|
||||
|
||||
# SSL
|
||||
letsencrypt/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user