Here’s what I use for performing backups. I use SSH with public key authentication. My file server running in a VM has two hard drives passing into my VM: one for general storage and one for storing movies and music.
My script involves rsync. Here’s a script for performing a full and partial backup:
grayson@grayson-epcotcenter ~ $ cat bin/backup-home-grayson.sh #!/bin/bash HNAME=nas BACKUPDIR=/data/nas/backups/grayson-epcotcenter/grayson-$(date +%Y%m%d-%H%M%S)-full rsync -e 'ssh' -ra ~/Documents \ ~/Videos \ ~/Storage \ ~/eBooks \ # ... ~/.mozilla \ ~/.ssh \ ~/.pki \ $HNAME:$BACKUPDIR # Document the date and time the files were backed up to a remote server. ssh $HNAME "date > $BACKUPDIR/backupdate.txt" grayson@grayson-epcotcenter ~ $ cat bin/diffbackup-home-grayson.sh #!/bin/bash HNAME=nas BACKUPDIR=/data/nas/backups/grayson-epcotcenter/grayson-$(date +%Y%m%d-%H%M%S)-diff rsync -e 'ssh' -ra --link-dest=/data/nas/backups/grayson-epcotcenter/grayson-20210701-093714-full \ ~/Documents \ ~/Videos \ ~/Storage \ ~/eBooks \ # ... ~/.mozilla \ ~/.ssh \ ~/.pki \ $HNAME:$BACKUPDIR > /dev/null ssh $HNAME "date > $BACKUPDIR/backupdate.txt"
Here’s how it looks like over the last couple of months:
[username-redacted]@nas:/data/nas/backups/grayson-epcotcenter$ du -h -d 1 ... 109G ./grayson-20210701-093714-full 377M ./grayson-20210705-174243-diff 417M ./grayson-20210709-010948-diff 422M ./grayson-20210713-143840-diff 53G ./grayson-20210723-170221-diff 176G ./grayson-20210805-013615-full ...
I do have NFS in my file server virtual machine, but the last thing I want is encrypting all my files for ransom in my NAS server, which is why I do not automatically mount my NFS share in my desktop PC unless absolutely necessary. Not even sshfs. Of course, I do not receive any kind of spam because I make use of 190+ email aliases (no catchall and + addressing at all). T-Mobile suffered a data breach recently, so even if I’m not affected, in addition to changing my password, I also changed my unique email address as well for T-Mobile so I can become a moving target and not get any phishing email messages. Is it overkill? Yes, but that’s because paranoia is part of my mindset in addition to protecting my privacy online.
I’m a Linux user for the past 10+ years and I have not encountered any malware since the since that time. So yeah, I do follow as much as I can regarding my security hygiene. I’m even protecting myself with NoScript and pfBlockerNG in pfSense. I don’t want to come across any form of malvertisement (malicious advertisement).
Sure, my thread might seem more like security-related than anything related to backup; however, my question is how do you perform your own backups from your desktop to your home server? Do you use a script like the one shown above?