Backup with rdiff-backup

These days I only have my laptop and an external harddisc. Within the last half year I already had to recover my file twice. The first time my mainboard said “good bye” to me and there was no possibility to get a replacement here. So transfer my files to a new laptop. The second time, I destroyed the master boot record and the partition table and was not able to fix it without reinstalling the system.

My backup should consist of my home folder and my MySql databases saved encrypted on my external disc. First I tried pyBackpack a graphical interface for rdiff-backup. But I got several problems using it, so I changed to the command line based program rdiff-backup, on which pyBackpack is based upon.

Rdiff-backup is a program to create an incremental backups of one folder in another folder. For example via network or in my case on an external drive. The official homepage tell about it:

A remote incremental backup of all your files could be as easy as
“rdiff-backup /”

For installing, use the package rdiff-backup.

$ sudo apt-get install rdiff-backup

For encryption my external harddisc is a TrueCrypt Container. When it is mounted I can backup my files using the following two commends.

$ rdiff-backup /home/phynformatik /media/truecrypt1/home/
$ sudo rdiff-backup /var/lib/mysql /media/truecrypt1/var/

Herewith the complete structure of each folder is copied. Starting a new backup only changed or new files will be copied. The actual state is directly in the backup folder. Older versions of your files are in the folder rdiff-backup. To recover the latest state it will do to copy the files and folders (inclusively the hidden ones) but rdiff-backup from the backup folder back to the original folder.

For me a backup of my home folder and my MySql databases is enough. Some more files which are worth to be backed up may be in /etc/ or /var/.