SFINX documents - the tar command and tapes

Types of tapes

There are various types of magnetic tapes that can be used as storage or backup media. At the Sterrewacht we have the following types of tapes: Currently, DAT tapes seem to be most widely available around the world, so if you are planning on taking your data to another institute, DAT might be the best choice.

The following machines have a tape device:

Under the SFINX environment, the device name of the tape device is always set in the $TAPE envirnoment variable, so that you nearly never have to tell a command the device name to work with.

An up-to-date listing of tapes can be obtained using the command devices tape.

compression

On some machines, compressed tape access is possible. Currently this is the case on all Exabyte and DLT units, and on the newest DAT units (DDS-3; on ijssel, melian, redshift, flow, merwede).

To use this feature, make sure you have the proper device name set in the $TAPE environment variable. The device names are indicated at a label on the tape device.

Beware that compressed backups cannot be read on all machines !!

The mt command

This command (whose name stands for "magnetic tape") is used to view the tape status, and spool the tape backward and forward. See the mt (1) man page for more detail.

The tar command

The most often used command to write or read tapes is tar, which stands for "tape archive". It can be used to make backups of (parts of) your data. There is also GNU tar (gtar) which has more options (including compression).

Files are always saved and restored with their full path name. This is both convenient and inconvenient: it allows a complete backup and restore with all the files in the same location, but one also has to be careful. If a backup is made with the command tar cv /home/strw/myname, then it is almost impossible to restore this backup on a system where no /home/strw disk exists. The smart way to do a backup is therefore to change to the directory you want to save, and then do tar cv ., because the current directory (.) will always exist on every UNIX system.

Note: GNU tar (gtar) is smart enough to correct this "mistake" automatically.

The most often used commands are:

See the tar (1) man page for more detail.

The Backup command

Backup is a SFINX script built around the tar command. Some people may like it, but it is never necessary to use it. Tapes written by Backup can be read by tar and vice versa.

Other commands that work with tapes

There is a couple of other programs that might be useful when dealing with tapes.

See also the section about the automatic backups.


David.Jansen@strw.leidenuniv.nl
Last modified: Thu Jan 14 10:13:37 1999