Everyone has a backup plan until the first drive dies. Mine died in October
- the NAS started logging read errors on a Sunday evening, and by Monday the second drive in the mirror was answering questions nobody should ask a hard drive. The data survived because of the routine below, so I am writing it down while I still feel grateful for it.
The shape of it
The rule is the old one: three copies, two different media, one offsite.
- Live data on the NAS and the mini PC.
- Nightly snapshots to a restic repository on the NAS itself - this is the fast, convenient copy for “I deleted the wrong folder” moments.
- Two USB drives, rotated weekly. One is plugged into the NAS, the other lives in a drawer at a relative’s house. Every Sunday I swap them.
The nightly job
A systemd timer runs a script that is deliberately boring:
#!/bin/bash
set -euo pipefail
export RESTIC_REPOSITORY=/mnt/backup/restic-repo
export RESTIC_PASSWORD_FILE=/root/.restic-password
restic backup /srv /home/tom --exclude-file=/root/restic-excludes.txt
restic forget --keep-daily 7 --keep-weekly 4 --keep-monthly 6 --prune
restic check --read-data-subset=5%
The check with a small random data subset is the part people skip. A
backup you never verify is a hope, not a backup. Once a quarter I restore a
random folder to a scratch directory and open a few files, just to prove
the whole chain still works end to end.
What I would tell a beginner
Start with the USB rotation. It feels primitive, but an air-gapped copy
that a ransomware infection or a fat-fingered rm cannot reach is worth
more than the cleverest cloud setup you haven’t tested. Automate the
snapshots, calendar the swaps, and test a restore before you need one.