Quiet Machines

Backups I can explain on a napkin

For years my backups were a cron job that rsynced a home directory to a second disk in the same machine. It survived exactly zero of the failure modes that matter: a failing PSU took both disks, and a bad rm was faithfully mirrored within the hour.

The replacement is boring on purpose. restic snapshots to an object-storage bucket, run from a systemd timer, with a second copy synced to a friend's NAS. Boring is the point: I want to be able to explain the whole thing on a napkin.

The unit

[Unit]
Description=restic backup
After=network-online.target

[Service]
Type=oneshot
EnvironmentFile=/etc/restic/env
ExecStart=/usr/bin/restic backup --exclude-caches /home /etc
ExecStart=/usr/bin/restic forget --keep-daily 14 --keep-weekly 8 --keep-monthly 12 --prune

The timer fires at 03:10 with a fifteen-minute RandomizedDelaySec, so the machines in the house don't all hit the bucket at once.

What I actually check

A backup nobody restores from is a rumour. Once a month I pick a file at random and restore it into /tmp. It takes two minutes and it has caught a broken environment file twice. restic check --read-data-subset=5% runs weekly and its exit code lands in a metrics endpoint so I notice when it stops.

The question is never "do I have backups". It is "how long until I'm working again".

For me that number is now about twenty minutes for a laptop and an afternoon for the server, which is good enough that I have stopped thinking about it — which was the goal.