By Kurt Seifried [email protected]
I don't know how many times I can tell people, but it never ceases to amaze
me how often people are surprised by the fact that if they do not backup their
data it will be gone, if the drive suffers a head crash on them or they hit
'delete' without thinking. Always backup your system, even if it's just the
config files, you'll save yourself time and money in the long run. This is even
on the SANS top 20 list.
To backup your data under Linux there are many solutions, all with various
pro's and con's. There are also several industrial strength backup programs, the
better ones support network backups which are a definite plus in a large
One of the other critical things to remember with backups is that whoever has
access to them (backup admin, cleaning staff) will have access to all your files
unless you encrypt the backups. Physically securing backups is critical,
damaging backups physically so they cannot be recovered is extremely easy, with
magnetic media simply place a strong magnet near them, for CD's simply
scratching the surface or cracking the CD will prevent usage. You should also
keep a relatively recent set of backups offsite in case the building burns down
or is inaccessible for some other reason (such as a chemical spill).
Non-commercial backup programs for Linux
There are numerous non commercial backup programs for Linux ranging from
simple tools suitable for saving a few files to professional multi-system
Tar and Gzip or Bzip2
Oldies but still goldies, tar and gzip. Why? Because like vi you can darn
near bet the farm on the fact that any UNIX system will have tar and gzip. They
may be slow, klunky and starting to show their age, but it's a universal tool
that will get the job done. I find with Linux the installation of a typical
system takes 15-30 minutes depending on the speed of the network/cdrom,
configuration another 5-15 (assuming I have backups or it is very simple) and
data restoration takes as long as it takes (definitely not something you should
rush). Good example: I recently backed up a server and then proceeded to blow
the filesystem away (and remove 2 physical HD's that I no longer needed), I then
installed Red Hat 5.2, and reconfigured all 3 network cards, Apache (for about
10 virtual sites), Bind and several other services in about 15 minutes. If I had
done it from scratch it would have taken me several hours. Simply:
tar -cvf archive-name.tar dir1 dir2 dir3....
to create the tarball of all your favorite files (typically /etc,
/var/spool/mail/, /var/log/, /home, and any other user/system data), followed by
gzip -9 archive-name.tar
to compress it as much as possible (granted
harddrive space is cheaper then a politicians promise but compressing it makes
it easier to move around). You might want to use bzip2, which is quite a bit
better then gzip at compressing text, but it is quite a bit slower. I typically
then make a copy of the archive on a remote server, either by ftping it or
emailing it as an attachment if it's not too big (e.g. the backup of a typical
firewall is around 100k or so of config files).
rsync is an ideal way to move data between servers. It is very efficient for
maintaining large directory trees in synch (not real time mind you), and is
relatively easy to configure and secure. rsync does not encrypt the data however
so you should use something like SSH or IPSec if the data is sensitive (SSH is
easiest, simply use "-e ssh").
Amanda is a client/server based network backup programs with support for most
unices and Windows (via SAMBA). Amanda is BSD style licensed and available from:
now ships standard with a number of distributions.
Commercial backup programs for Linux
BRU (Backup and Restore Utility), has been in the Linux world since as long
as Linux Journal (they have had ads in there since the beginning as far as I can
tell). This program affords a relatively complete set of tools in a nice unified
format, with command line and a graphical front end (easy to automate in other
words). It supports full, incremental and differential backups, as well as
catalogs, and can write to a file or tape drive, basically a solid, simple, easy
to use backup program. BRU is available at http://www.tolisgroup.com/products3.html.
Quickstart is more aimed at making an image of the system so that when the
hard drive fails/etc. you can quickly re-image a blank disk and have a working
system. It can also be used to 'master' a system and then load other systems
quickly (as an alternative to say Red Hat's KickStart). It's reasonably priced
as well and garnered a good revue in Linux Journal (Nov 1998, page 50). You can
get it at: http://www.tolisgroup.com/products3.html.
Legato Networker is another enterprise class backup program, now completely
supported on Linux as both client and server. You can get it from: http://www.legato.com/.
There are more things to back data up onto than you can drive a range rover
over but here are some of the more popular/sane alternatives:
|Name of Media
||It's fast. It's cheap. It's huge (160 gigs). It's pretty
reliable. ($2-$3 USD per gig)
||It might not be big enough, and they do fail, usually at
the worst possible time. Harder to take offsite as well. RAID is a viable
option though. |
||Not susceptible to EMP, and everyone in the developed world
has a CDROM drive. Media is also pretty sturdy and cheap ($0.20 USD per
650 Megs or so)
||CDROM's do have a finite shelf life of 5-15 years, and not
all recordables are equal. Keep away from sunlight, and make sure you have
a CDROM drive that will read them. |
||It's reliable, you can buy BIG tapes, tape carousels and
tape robots, but they're not very cheap.
||Magnetic media, finite life span and some tapes can be
easily damaged (you get what you pay for), also make sure the tapes can be
read on other tape drives (in case the server burns down....).|
||I'm not kidding, there are rumors some people still use
these to backup data.
||It's a floppy. They go bad and are very small. Great for
config files though.|
||I have yet to damage one, nor have my cats. They hold 100
megs which is good enough for most single user machines.
||Not everyone has a zip drive, and they are magnetic media.
The IDE and SCSI models are passably fast, but the parallel port models
are abysmally slow. Watch out for the click of death.|
||1 or 2 gig removable hard drives, my SCSI one averages 5
||They die. I'm on my third drive. The platters also have a
habit of going south if used heavily. And they aren’t cheap. They are
||120 Megs, and cheap, gaining in popularity (hah, I actually
believed that). These things are dead as far as I can tell.
||Slow. I'm not kidding. 120 megs over a floppy controller to
something that is advertised as "up to 3-4 times faster then a floppy
||Very long shelf life. requires a standard Mark 1 human
being as a reading device. Handy for showing consultants and as reference
material. Cannot be easily altered.
||You want to retype a 4000 entry password file? OCR is
another option as well.|