Markgraf

Web Design

  • Increase font size
  • Default font size
  • Decrease font size
Home Home Open Source - Linux - Ubuntu Backup and Recovery

Security II - Backing up your data and installation

E-mail Print PDF

Backing up your data and installation

There are many good tools for this function available in the Linux world. When you start to analyze them they all seem to have a certain similarity in the way that they work. In my Windows incarnation I was using a product called SyncBack (the free version) which I thought very good (once I managed to figure out how to use all of it's bells and whistles.) What I have decided on in Ubuntu is a mix of packages, selected based on four different types of back-up . You probably could use one or perhaps two of these tools if you had the time to delve into their inner workings, but I tend to be in a hurry, so I settled on all four, each one for a specific type of data that I have on my PCs.

Type I Backup - Standard "My Documents" type data

This is your plain vanilla situation. Your HDs are full of spreadsheets, letters, notes etc. The files tend to change a lot and having a daily snap shot of them is what you need for possible recovery. This type of backup is a 'piece of cake' for a package called 'sbackup', available from the Ubuntu Synaptic Manager. Simple Backup is just that. You give it a few basic parameters as to what to backup and what not to (it even provides suggestions), and when and how deep you want your backups to be and you're done. It runs in the background making full and incremental backups on the schedule you give it, saving the results in a series of compressed (tgz) files.

Type II Backup - Non compressible files

A high percentage of the data that I have on my PCs is non compressible, that is, it already is compressed. As I mentioned earlier, we have a very large library of photographs, mostly in RAW and JPG files. We also have a lot of music since I have loaded our CD and vinyl collection. This type of data has two qualities that make it unsuitable for the Type I backup scenario - the data is fairly static and, as mentioned, it is not compressible. If we used Simple Backup we would burn a lot of CPU as it tries to compress the data and gain virtually nothing! Also, in the FULL backup cycle Simple Backup would do this for the entire collection, even though nothing had changed. To overcome these two handicaps I use 'rsync' for this type of data.

Rsync comes with Ubuntu, but it is a command line utility with a long list of parameters. To make it easier to use you can install 'grsync' and 'gtksync' which are GUI front ends for it. Grsync gives you a tool to build the rsync command itself, and Gtksync shows you the results of the command as they occur. You also can simulate an execution of the backup as well.

Part of the result that Gtksync shows you is the actual rsync command, which you can copy and paste to a script file and execute using CRON on a daily basis.

Using this type of backup will make the process of backing up static non compressible files a snap!

Type III Backup - "Synchronization"

This type of backup is not truly a backup. The data most likely has been protected by the Type I scenario above, but there is a further 'problem'. You want this data to be the same on all of the PCs in the network. I use this method for very specific situations, like my gnuCash database.

For this situation I am using a package that was developed at the University of Pennsylvania called Unison. A version of Unison is available from the Ubuntu Synaptic Manager. What I have established is that my primary desktop is a Unison server in a star network. Each PC that needs a copy of the data connects to the server (using an SSH session) and synchronizes it's current version with the version on the server. Usually what this means is that before a trip I synchronize my laptop with the server, making the laptop the same as the server, and then, on my return, I re-synchronize, updating the server with any changes that were made during the trip.

This can get procedurally complicated, especially if there are more than two people and/or computers involved. As an alternative to this type of backup, I am currently experimenting with an Internet service called DropBox. It seems to work very well and they offer a free package with 2GB of space for file synchronizations. It's worth a look if you have this situation.

I will go into more details on the SSH server / client setup in another, future, article.

Type IV Backup - Ubuntu Installation

Some combination of the above three options for backup should take care of all of the data that is 'yours'. That brings you to the question - What about Ubuntu and all of the packages that you have installed to make your PC a useful tool? The solution to that is called APTonCD!

APTonCD is a package available from the Synaptic Manager that, simply put, makes a CD / DVD version of all of the packages that you have installed on your Ubuntu machine. This CD, in conjunction with the original LIVE CD that you used to originally install Ubuntu will bring you back to the pre-crash operating system - software package installation that you had. You can even use it - as I do - to make sure that all of the PCs you have running Ubuntu have the same software configuration.

APTonCD runs with a GUI interface from System - Administration - APTonCD. Just fire it up and follow the on-screen dialog and you will create a CD / DVD which, when loaded into the CD drive, will prompt you through the re-installation of all of the packages on your computer.