Subsections
Backups are important under any operating system. Debian GNU/Linux provides
several different utilities that you might want to use. Additionally, while
many of these utilities were aimed at tape backups originally, you'll find that
they are now being used for other things. For instance, tar is being
used for distributing programs over the Internet. Some of the utilities that
you'll find include the following:
- Taper is a menu-driven, easy-to-learn backup program that can back
up to a variety of media. Its limitation is that it doesn't handle large (4GB
or larger) backups.
- dump is designed specifically for tapes; its main strengths are its
interface for file restores, low-level filesystem backups, and incremental backup
scheduling. Its limitations include the inability to back up NFS or other non-ext2
filesystems and some rather arcane defaults.
- GNU tar (short for Tape ARchiver) is an implementation
of what is probably the most widely used backup or archiving utility in Linux
today. It makes a good general purpose tool and can deal with the widest variety
of target media. Additionally, many different systems can read tar
files, making them highly portable. tar's weaknesses include a weaker
incremental backup system than dump and no interactive restore selection
screen.
tar
Because tar is used so much, and for quite a bit in addition to backups,
it is being described here. For more details, see the tar manual page;
instructions for viewing manual pages can be found in section 5.1
on page .
tar is an archiver. This means that tar can take many
files and combine them all into one large file or write them out to a backup
device such as a tape drive. Once you have this one large file, you will often
want to compress it; the -z option is great for this. Hence, tar
offers a great way to distribute programs and data on the Internet, and you'll
find that it is used extensively for this purpose.
Here's a sample tar command line:
-
- tar -zcvf myfiles.tar.gz /usr/local/bin
Let's take a look at how this command can be broken down:
- tar
- Name of the command.
- -
- Tells tar that options will follow.
- z
- Tells tar to use gzip compression automatically;
if you use this, it's good to add a .gz extension as well.
- c
- Tells tar to create a new archive.
- v
- This says to be verbose; that is, it tells tar to let you
know what it's doing while it creates the archive.
- f
- This indicates that the next thing on the command line is the name
of the file to be created or the device to be used. If I used /dev/st0
here, for instance, it would write the backup to the tape drive.
- myfiles.tar.gz
- This is the name of the file to be created.
- /usr/local/bin
- This is the name of the file or directory to store
in the archive. It's also possible to specify several items here.
You may often find tar.gz files (or simply tgz files) on the
Internet. You can unpack these with a command like:
-
- tar -zxvf filename.tar.gz
John Goerzen / Ossama Othman