Member-only story
Testing borg backups on Mac OS X
Backups are your last resort. If you are using a backup, generally this means that everything else has failed. I described what I use for backups, borg and where I store it, Borgbase. But what if I actually need that backup? Testing your backups is one of the key steps to your backup strategy and should not be overlooked.
My first test was to attempt to restore a backup to the same machine.
$ mkdir blah
$ cd blah
$ export BORG_PASSPHRASE='thisismyrealpassword'
$ borg extract XXXXXXX@XXXXXX.repo.borgbase.com:repo::my-snapshot
Above I’ve created a temporary directory “blah”, and will restore data from the backup “my-snapshot”. Borg, like most unix commands, completes silently
$ ls
Amazon Photos
$ find . |wc -l
42
I can see the directory was created and 42 files have been restored on this host. I could be more through and verify the checksum of the files from their original, but because my backup (and restore) are images, a brief glace at the files in finder lets me know that they are in tact.
This is the best case scenario. I’m backing up from this host, and restoring to a different directory on this same host. If you are in a worst case scenario, where your host is compromised or unavailable, will your backups work? As a final test, I try to restore from a…