meow's notes

· 5 min read

Backups are only real once you've restored them

For years my backup strategy was “there's a cron job, it probably works”. Then a drive in the old NAS started throwing read errors on a Sunday morning, and I got to find out exactly how much of that assumption was true. Short version: most of it, but not all, and the part that didn't work was the part I'd never actually tested.

What I had

A nightly restic backup job pushing a handful of directories to a Hetzner Storage Box over SFTP, with a retention policy pruning weekly. It had been running quietly for two years. Nobody had ever run restic restore against it for real.

0 3 * * * /usr/local/bin/restic backup /srv/data --tag nightly \
    && /usr/local/bin/restic forget --keep-daily 14 --keep-weekly 8 --keep-monthly 12 --prune

The gap

The restore itself worked fine. What didn't was that one bind-mounted config directory had quietly stopped being included after a docker-compose refactor eight months earlier — the path changed, the backup job didn't, and nothing alerted because restic backup doesn't fail just because a directory is smaller than it used to be.

I only noticed because I did a full restore into a scratch VM and diffed it against the live host, which is not something I'd been doing regularly before this.

What changed

A backup you haven't restored is a hypothesis, not a backup.

None of this is novel advice. I'd read it a dozen times before it happened to me anyway, which is probably the actual lesson here.