The question: what is the best way to automate a scheduled backup of the small, personal files on a workstation, like SSH keys, saved terminal sessions, and notes, to a USB drive or a NAS, and how do you test that a restore actually works? I have a method, but I would like to compare it with yours.
This is not the "back up my whole PC" question. I mean the few hundred kilobytes that cost you an afternoon when they vanish: ~/.ssh, PuTTY or terminal session exports, config files, a folder of plain-text notes.
My lean is a boring script on a timer, not a backup suite. Something like this on Linux:
rsync -a --delete-excluded ~/.ssh ~/notes ~/.config/myapp /mnt/nas/ws-backup/$(hostname)/
Run it from cron or a systemd timer, once a night. On Windows, robocopy and Task Scheduler do the same job. Two cautions. First, SSH private keys should land on storage you trust, and ideally inside an encrypted archive or volume. A NAS share that half the house can read is not that. Second, keep permissions in mind. Copy a key to a FAT-formatted USB stick and the file modes are gone, and ssh will refuse the key until you fix them.
The restore test is where most people stop, and it is the part I care about:
- Once a quarter, restore into an empty scratch folder, not over the live files.
- Compare it against the source with
diff -ror a checksum listing. - Actually use one restored key to log in somewhere harmless. A file that exists is not a file that works.
- Write the date and the result in the binder.
A backup nobody has restored is a hope, not a backup.
What do you use for the schedule, and how do you handle the private keys? And does anyone actually run a restore drill, or is it just me and my binder?