Backups in a Linux Environment

Backups are an important task within any environment. While there are multiple options for performing backups on a Windows network, you may not be aware of the  options available for a Linux environment. Given the fact that I work strictly in the Linux world, both at home and at the office, I can offer some suggestions as to what options are available. We’ll stick with open source (free) solutions here, although there are many commercial products available.

             Bacula (http://www.bacula.org/) is the big player in the enterprise level network backup game. Setup and configuration of Bacula is a job for intermediate/advanced Linux users, although once installed and configured there is a very easy-to-use web GUI for administration.

             Another good product is Mondo Rescue (http://www.mondorescue.org/). While this application can be used for backup, it is designed more as a disaster recovery tool. Mondo Rescue creates bootable CD/DVD’s that contain snapshots of a complete system (ala Ghost or True Image) which can be used to restore a system from bare metal.  It’s administered from a simple text-based GUI and packages are available for most Linux distributions. Installation and use is simple enough for the average Linux user.

             Next up is Amanda (http://www.amanda.org/). The source code is available at the Amanda web site, but a quick Google search will net you a package in the proper format for your particular flavor of Linux. This is strictly a command line tool, so it’s best left to those power users that are comfortable working without a GUI. This is a very powerful and flexible backup application.

             Of course if you are not looking for a network type solution and just want something to backup your own machine, almost all Linux distributions come prepackaged with some type of easy-to-use GUI based software. The KDat application included with the KDE desktop is one example. Several folks have written their own and made it freely available to us all.  http://simplelinuxbkup.sourceforge.net/ for example.

             While I am by no means a code-monkey, I have learned enough basic shell scripting to write my own backup software. It works equally well for stand alone machines or as a network solution. You can find it here (you’ll have to be a registered member):

http://www.theforcefield.net/joomla/index.php?option=com_docman&task=cat_view&gid=911&Itemid=53  


             My backup software consists of a simple script that runs as a scheduled job and uses ‘tar’ to create compressed backup files. The default is to backup the /home directory daily and perform a full backup weekly. A copy of the backup is stored on the local machine (so that you may manually burn it to CD/DVD, archive it to a tape drive, copy to a USB stick, FTP it somewhere, etc.). This software can optionally use ‘rsync’ to automatically push a copy of the backup to a network storage device. I use an old server with a multiple scsi disk array, but you could use an external enclosure with a large hard drive attached to another Linux machine or even push the backup across the WAN to an off-site storage device running Linux. Another option would be to automatically FTP the tar files to any local or remote FTP server (although you will have to learn a bit of shell scripting and write this code yourself).  *NOTE: If you choose the preceding FTP option, PLEASE consider security and use SFTP or tunnel through a VPN! Full restores can be done simply by partitioning and formatting a new hard drive and then extracting the compressed tar file onto the disk. If you delete something important from your home directory, you can simply extract the /home tar file stored on the local machine back into your existing /home directory. Basic instructions are in the README, and the scripts are liberally commented.

             As always, if you have any questions, comments, problems, or want to erect a statue in my likeness, please feel free to contact me at thughes@fwpm.com .

 

Copyright 2008 Todd Hughes

Leave a Comment