Off-Site Encrypted Backups with Restic and Quarterly Restore Drills
RAID mirrors save you from a dead spindle on a Tuesday afternoon; they cheerfully replicate an accidental rm -rf, a corrupted filesystem journal, or a flooded basement across both drives in milliseconds. My rule at home is simple: any directory worth keeping lives on local ZFS datasets, gets snapshotted nightly onto a second box in the coat closet, and ships encrypted to object storage off-site.
I settled on restic three years ago because its repository format is self-contained, content-addressed, and encrypted client-side before a single byte leaves the LAN.
Keeping noisy caches out of snapshots
Nothing bloats an off-site backup bill faster than accidentally archiving ~/.cache, Rust target/ trees, or virtual machine scratch images. Before even writing the wrapper script, I drop a standard CACHEDIR.TAG marker into disposable build folders and pair --exclude-caches with a short exclude file:
#!/usr/bin/env bash
set -euo pipefail
export RESTIC_REPOSITORY="s3:s3.us-west-004.backblazeb2.com/home-archive-bucket"
export RESTIC_PASSWORD_FILE="/etc/restic/repo.pw"
source /etc/restic/b2.env
restic backup \
--one-file-system \
--exclude-caches \
--exclude-file=/etc/restic/excludes.txt \
/srv/documents \
/srv/photos \
/home/evan/projects
restic forget \
--keep-daily 7 \
--keep-weekly 5 \
--keep-monthly 12 \
--keep-yearly 3 \
--prune
restic check --read-data-subset=5%
Passing --read-data-subset=5% at the tail of each nightly run downloads and hashes a deterministic slice of pack files so silent bitrot in remote storage surfaces within a few weeks rather than on the day of an emergency.
Backups don’t exist until you restore onto bare metal
Once a quarter—usually the first Saturday of March, June, September, and December—I pick a fresh temporary directory on my laptop, pull the repository password from my offline paper recovery sheet in the desk safe, and run a blind restore test:
mkdir -p /tmp/restore-drill
restic -r "$RESTIC_REPOSITORY" restore latest \
--include /srv/documents/tax-2024 \
--include /srv/photos/2023/2023-10 \
--target /tmp/restore-drill
The very first time I ran that drill two years ago, I discovered that my environment file had the bucket read/write key stored only on the NAS itself—meaning if the NAS died, I would have needed to reset credentials in a browser before pulling a single file. Catching gaps like that on a calm Saturday morning with a mug of coffee is the whole point.