A backup routine for one small server
One small server runs this site and a few side projects. Losing it would be annoying, not tragic, and the backup routine is sized for exactly that. It has four parts.
Nightly dump
At 03:10 a timer dumps the database to a local folder and archives the few directories that matter. Everything else can be reinstalled from notes.
Encrypt, then ship
The archive is compressed, encrypted with a public key, and uploaded to object storage in another region. The private key is not on the server. If the server is ever compromised, old backups stay unreadable.
Keep a sensible history
A lifecycle rule on the bucket keeps seven daily copies, four weekly and six monthly. No script decides what to delete, so no script can delete the wrong thing.
Test the restore
A backup you have never restored is a hope, not a backup. On the first Sunday of the month I start a throwaway machine, restore the newest archive, and click through the sites. It takes twenty minutes and has caught two problems so far: a missing folder and an expired key.
Know when it stops
A tiny check looks at the age of the newest object in the bucket. If it is older than 30 hours, I get a message. Silence is the failure mode backups usually have, so the check is the most useful part of the whole setup.