A number of months ago I made the decision to start making back-ups of my data. There was no event that caused this to happen, but rather a conversation with a friend that convinced me it was a good idea. So I purchased a USB drive and used TrueCrypt to encrypt the drive (this actually wasn’t a super-great idea since I now have to manually mount the drive before I can do a back-up).
For software, I used deja-dup which comes standard with Ubuntu. At the time I used Ubuntu on my desktop and laptop. It was a very easy to use, so kudos to the deja-dup team. At some point I updated my laptop to use Xubuntu and decided against using deja-dup because it had some gnome dependencies (though looking at it now it doesn’t seem to have many dependencies now, but there are still some gnome ones). I know deja-dup was basically a front-end for duplicity for managing back-ups, so I just learned the command-line interface.
It actually turned out to be pretty simple. I will paste the command and what each flag means:
duplicity incremental --full-if-older-than 1M --no-encryption --log-file /tmp/dup.log --verbosity info --ssh-askpass --exclude-globbing-filelist="$HOME/.duplicity-file-list" $HOME ssh://me@someserver//backup/location > /tmp/dup2.log
|incremental||do an incremental back-up. This saved a ton of time because only files that changed will get backed-up|
|–full-if-older-than 1M||This is set to 1 month. This creates a full backup every month. I do not recall why I chose 1 month.|
|–no-encryption||The drive is encrypted so I don’t need to encrypt the files|
|–verbosity info||This was used mainly for debugging and making sure the files I wanted backed-up was happening|
|–ssh-askpass||prompt for the ssh password. Typically I leave the drive attached to my desktop, so I have to ssh to the desktop to perform the back-up|
|–exclude-globbing-filelist=”$HOME/.duplicity-file-list”||in my home directory I have a hidden file that contains the contents:
+ /home/me/.ssh - /home/me/Downloads ...
This tells duplicity to back-up the .ssh directory, but do not back-up the Downloads directory
|$HOME||back-up my home directory|
|ssh://me@someserver//backup/location > /tmp/dup2.log||the location of the back-up directory. I also redirect the log file to the temp directory.|
This has been going on for several months and thankfully I didn’t need it until a few days ago when a botched Ubuntu 13 upgrade (PS. Never fall asleep during an upgrade) gave me a nice “General error mounting filesystem” boot-up message. While annoying, it did at least give me an opportunity to try Linux Mint.
But Linux Mint had no option to save my files. It was going to remove all my documents and saved files as part of the installation process. I hesitated for a bit. While I did have back-ups, I think I only done recoveries on a small scale and a long time ago. I decided to go for it anyways. The installation was quick and flawless, but it was time to do a recovery. I checked to see whether Mint had deja-dup and they did not. The had their own tool for backup. So I opted to do it over the command-line. It actually wasn’t that bad. The command for that was:
duplicity --file-to-restore home/me/Documents file:///backup/location /home/me/Documents
|–file-to-restore home/me/Documents||The file/folder you want to restore. Note that this does not have the leading /|
|file:///backup/location||Location of my back-ups. I used file:// URI because this was on my desktop so I did not ssh to anywhere|
|/home/me/Documents||The location I want the back-up to|
This actually went pretty smoothly. The only issue I hit was a few files that had long filenames and duplicity failed to recover those. I have not found a solution to this problem yet.
The duplicity man page is quite nice. Lot’s of information, but you can find what you’re looking for quite easily.