Delivered each Tuesday, TechRepublic's free Linux NetNote provides tips, articles, and other resources to help you hone your Linux skills. Automatically sign up today!
There are numerous backup utilities available—free of cost and commercial—and each has its own strengths and weaknesses. One free tool that's worthy of mentioning is called rdiff-backup. This backup utility performs full backups, but it also saves changed files so that you have a fully up-to-date backup and retain a history of changed files.
For remote administration, rdiff-backup works similar to rsync, which means you can use it to securely perform remote backups over ssh. It also preserves all attributes, including device files, hard links, and permissions.
In order to use rdiff-backup, you need to download and compile both the rdiff-backup utility and librsync. This is easily completed by using the traditional "configure; make; make install" for librsync and the following for rdiff-backup:
# python setup.py build
# python setup.py install
Once you have rdiff-backup installed, be sure to read the rdiff-backup manpage to learn about the various options. In it's simplest form, you can use it as a personal backup tool for your home directory. Run the following command:
$ rdiff-backup —print-statistics /home/user /backup/home/user
This will make a mirror backup of the /home/user directory in the /backup/home/user directory. The —print-statistics option tells rdiff-backup to provide an overview of what happened, otherwise it runs silently.
The rdiff-backup utility is perfect for backing up directories that change often, such as /home or /etc. Since rdiff-backup stores changed files, it can restore the contents of any directory back to a previous state; which is invaluable if you make a lot of changes to configuration files or accidentally delete files that you later require.
To download or find out more information about rdiff-backup, visit the nongnu Web site.
Vincent Danen works on the Red Hat Security Response Team and lives in Canada. He has been writing about and developing on Linux for over 10 years and is a veteran Mac user.