Simple Sneakernet Backups

The easiest way to back up data is to synchronize your data to a coud. For this, I use Syncthing and various cloud services. But, if I accidentally delete something important and that delete operation is synchronized to my cloud-based backups before I catch it, that data is lost. For true offline and delete-resistant backups, nothing beats the sneakernet. The cheapest way to back up a home computer is to purchase a USB hard drive, plug it in, and copy files. And, you don't need any special software to make this work. Any POSIX machine with tar and gpg can make an encrypted backup.
First, disable sleep on the device that will be backing up the data.
Next run the following command to back up your data:
SOURCE=/home/you
DESTINATION=/media/mounteddrive/backup-2020-02-05.tar.gz.gpg
tar czvpf - $SOURCE | gpg --symmetric --cipher-algo aes256 -o $DESTINATION
You'll be prompted for a symmetric AES password.

And, to restore:
SOURCE=/media/mounteddrive/backup-2020-02-05.tar.gz.gpg
DESTINATION=/home/you
(cd $DESTINATION; gpg -d $SOURCE | tar xzvf -)
What's great about this is that you are using ubiquitous free open source tools. You know that wherever or whenever you plan to restore this data, you'll be able to.

No comments

Post a Comment