A Backup Strategy You Can Actually Restore From
Published On
Oct 06, 2026
Category
- Operations
- Backup
The uncomfortable truth about backups is that most of them are never tested, and an untested backup is just a hopeful directory. The job is not “we run a backup job nightly.” The job is “we can get our data back, within a known time, when something has gone wrong.” Everything below works backward from that.
The 3-2-1 rule, and why it still holds
The rule is old because it keeps being right:
- 3 copies of your data (the live copy plus two backups).
- 2 different media or storage types, so a single failure mode cannot take both.
- 1 copy off-site, so a fire, flood, or ransomware event in one location does not end you.
Ransomware is the modern reason the off-site copy matters most. If your backup target is writable from the machine being backed up, attackers encrypt it too. The off-site, append-only or credential-isolated copy is your real safety net.
Why restic
We reach for restic because it gets the fundamentals right without ceremony:
- Encrypted at rest by default — the repository is useless without the password.
- Deduplicated at the content-chunk level, so unchanged data is stored once across all snapshots.
- Snapshot-based, so every backup is a point-in-time view you can browse and restore individually.
- Many backends — local disk, SFTP, S3-compatible object storage, and more.
Initialise a repository against object storage:
export RESTIC_REPOSITORY="s3:https://s3.example.com/backups-prod"
export RESTIC_PASSWORD_FILE="/etc/restic/password"
export AWS_ACCESS_KEY_ID="..."
export AWS_SECRET_ACCESS_KEY="..."
restic init
Take a backup with sensible exclusions:
restic backup /etc /var/lib/app /home \
--exclude-caches \
--exclude='*.tmp' \
--tag nightly
Schedule it with a systemd timer
Cron works, but a systemd timer gives you logging, retries, and clean status out of the box.
# /etc/systemd/system/restic-backup.service
[Unit]
Description=restic nightly backup
After=network-online.target
[Service]
Type=oneshot
EnvironmentFile=/etc/restic/env
ExecStart=/usr/bin/restic backup /etc /var/lib/app /home --exclude-caches --tag nightly
ExecStartPost=/usr/bin/restic forget --prune \
--keep-daily 7 --keep-weekly 5 --keep-monthly 12 --keep-yearly 3
Nice=10
IOSchedulingClass=best-effort
IOSchedulingPriority=7
# /etc/systemd/system/restic-backup.timer
[Unit]
Description=Run restic backup nightly
[Timer]
OnCalendar=*-*-* 02:30:00
RandomizedDelaySec=900
Persistent=true
[Install]
WantedBy=timers.target
systemctl enable --now restic-backup.timer
Persistent=true catches up a missed run if the host was off. RandomizedDelaySec staggers a fleet so they don’t all hammer the object store at 02:30 exactly. The Nice and IO scheduling settings keep the backup from starving production workloads.
Retention and pruning that makes sense
A backup that grows forever eventually costs more than the data is worth. restic’s forget policy keeps a tapering set of snapshots and --prune reclaims the space.
restic forget --prune \
--keep-daily 7 \
--keep-weekly 5 \
--keep-monthly 12 \
--keep-yearly 3
Read this as: every day for a week, every week for a bit over a month, every month for a year, every year for three. That is plenty of granularity for recent mistakes and enough history for the “what did this look like last spring” question — without unbounded growth. Run forget after each backup, but prune (the expensive part) can run less often if your object store charges per operation.
Protect the repository from the host it backs up
If the backup credentials on a server can delete snapshots, then anyone who compromises the server can delete your backups. Mitigate it:
- Use append-only credentials for the backup job, and keep separate full-access credentials offline for pruning.
- On S3-compatible stores, enable object lock / versioning so deletes are recoverable.
- Keep the repository password in a secrets manager, not in the same backup it protects.
The part everyone skips: test the restore
A restore you have never performed is a restore you do not have. Make it routine.
Verify repository integrity, reading a sample of the actual data:
restic check --read-data-subset=5%
List what you have and inspect a snapshot:
restic snapshots
restic ls latest /var/lib/app
Do a real restore to a scratch location and compare:
restic restore latest --target /restore-test --include /var/lib/app
diff -r /var/lib/app /restore-test/var/lib/app
Then go further on a schedule that matters: once a quarter, restore to a clean machine and actually bring the service up from the restored data. Time it. That number is your real recovery time — the one you can put in front of management — not the optimistic figure in a runbook nobody has exercised.
Make it boring
A good backup system is one you stop thinking about because you have proven, repeatedly, that it works. Three copies, two media, one off-site. Encrypted, deduplicated snapshots on a timer. A retention policy that tapers. Credentials that can’t be turned against you. And — above all — a restore you have personally performed recently enough to trust. The day you need it, you want certainty, not hope.