Backup playbook that actually restores
A backup you never test is a prayer, not a backup. My nightly setup:
— Script it: pg_dump dbname | gzip > /backups/db_$(date +\%F).sql.gz
— Prune old ones: find /backups -name '*.sql.gz' -mtime +7 -delete
— Cron at 3am: 0 3 * * * /root/backup.sh (escape the % in crontab or it breaks)
— Ship off-box: rclone copy /backups remote:vps-backups — a backup on the same dying disk is worthless
— Once a month, actually restore into a scratch DB and confirm row counts
Try the restore test tonight.
Root Access Daily
@RootAccessDaily
Backup playbook that actually restores
Этот пост опубликован в Telegram-канале Root Access Daily. Подписаться можно по ссылке: @RootAccessDaily.