To start taper, type taper at the command line. You will be presented with a menu from which you select the appropriate option. To move between options, press the up or down arrow (or left & right). To select and option, press the ENTER key.
taper accepts the following command line options. Note that there are two formats for options - short (one letter) and long (GNU style). Either one (or a mixture of both) can be used. Alternatively, options can be stored in a preference file (see below for details).
which tape drive you are using. There are three valid options
scsi drive
ftape based tape drive
zftape based tape drive (or ftape version >= 3)
ide based tape drive
a regular file on the hard disk
a device that needs mounting, eg. floppy disk
prints help on command line options
Append files to archive if it exists. Default.
Overwrites existing archive if found.
NOTE: The append options are only for unattended backups. If you use the main taper program, you will be prompted for whether you wish to append or overwrite an existing archive.
Prints differences between the archive and filesystem. If archive_id equals 0, then the tape that is in the tape drive is used, otherwise, uses archive_id.
After restoring a file, restore the ownership attributes of the file
Don't attempt to set the ownership attributes of a file after restore
use file as the rewinding archive file. If not specified, will use the file specified in the environment variable TAPE. You can use a networked format like tar (eg. myhost.com:/dev/tape to use the tape drive on myhost.com).
use file as the non-rewinding archive file. If not specified, will use the file specified in the environment variable NTAPE. You can use a networked format like tar (eg. myhost.com:/dev/tape to use the tape drive on myhost.com).
equivalent to -n file -f file useful when not using tape drives, but archive files. You can use a networked format like tar (eg. myhost.com:/dev/tape to use the tape drive on myhost.com).
a list of files not to include in the backup. Consists of a series of suffixes to exclude separated by spaces. It is not case sensitive (ie. .o is the same as .O) For example, the default setting of ".o ~" excludes all files that end in .o and all files that end in ~ .
When doing a mkinfo or complete restore, if a file with a bad checksum is encountered, you will have the option of trying to continue, or assuming the rest of the backup is bad and fudging the info file to reflect this. Default.
When doing a mkinfo or complete restore, if a file with a bad checksum is encountered, will try to continue without prompting.
No compression
Use an external compression program. The program to use is hard compiled and can be changed by editing defaults.h. The default is set to use gzip.
Use the internal compression program which is similar to compress. It doesn't provide as good a compression as gzip but it is much quicker. Note that this compression uses about 2MB of RAM extra so on heavily loaded machines, it can degrade performance. Default.
Use the internal compression program which is similar to gzip. It provides the same level of compression as gzip and is much quicker than the external version. It is not as quick as option 2, but much faster than 1. In addition, it doesn't use anywhere near the memory or system load that 2 requires.
Specifies which group of files to exclude from compressing. Comprises a string of suffixes separated by a space - eg. ``.gz .gif'' would exclude files ending in .gz and .gif. It is not case sensitive (ie. JPG = jPg etc..) Default is ``.gz .gif .Z .zip .jpg .bmp''
gzip is used for compression. It assumes that gzip is on your path. If you use another compress program, change the entry in defaults.h and recompile.
Prints the directory of the archive whose id is archive_id and exits. If archive_id equals 0, then the directory of the archive of the tape currently in the drive is printed.
If this option is on, in restore, if there are any empty directories, they will automatically be skipped. For example, your files may be in /usr/local/src/xzy with nothing in /usr, /usr/local or /usr/local/src. When you select /usr from the top restore directory, you will automatically be placed in to /usr/local/src/xyz where the files are, and the empty directories will be skipped. Default.
Turn the above off.
When selecting restore, prints a list of all known archives and the user can select which one of these to restore from. Default.
When selecting restore, automatically selects the archive in the tape drive (or regular file). User not given the option of which archive s/he would like to restore from
Tells taper that your tape drive supports a seek ioctl for positioning to a particular block. Default depends on tape drive type.
You tape drive doesn't support an ioctl for positioning to a particular block. Taper will use reads to position. Default depends on tape drive type.
Title of volume. Default is NULL. Only applicable in backup.
If this option is defined, then after taper opens a tape, it tries to get the block size using an ioctl call. This is only for the new zftape driver. Default is on for zftape and off for others.
Do not try and get the block size.
With soft links, store link details only and not linked file. Default.
With soft links, store the file, not the link.
It is useful for taper to always have a full buffer of data available to send to the tape drive so that the tape drive never has to sit and wait. This can be a problem if compression is taking a long time. By giving the compression program a head start, you can try and ensure that taper always has data available to write. A good starting number for large backups is 10 minutes. Default is 0.
directory where archive information files are saved. Also where file sets are saved. Default ~/taper_info).
turns on compression of info files. Automatically will compress &after creation and will decompress when required. Default.
Don't compress info files.
This specifies the device number of the /proc system. This is avoid backing up of the /proc filesystem which is a runtime filesystem used to store the current state of the operating system. If this value is set to 0, then no checking is performed. The default value is 1 (which is the device number of the /proc filesystem under Linux).
When restoring, if the tape needs to be advanced by less than min-before-seek blocks, then a seek will not be issued, rather the tape will continue streaming. This is because if you have a lot of files close together, it's more efficient to just let the drive continue streaming. Default 10.
When using a new tape, overwriting a tape with unrecognized data, or when overwriting existing taper files, if this option is set, taper will try and erase the tape using a standard ioctl call. Floppy tape drives (those based on ftape and zftape require this option to be set.
Will not try to erase a tape before writing new data to it. Most SCSI drives do not require erasing, so you can use this option for them.
Tells taper that your tape drive correctly handles the end of tape condition. Use the utility test end of tape to see if your tape drive handles this properly. Default.
Tells taper that your tape drive doesn't handle the end of tape condition as per BSD semantics. Use the utility test end of tape to see if your tape drive handles this properly.
When taper encounters an error in the tape, it asks you whether this signifies an end of tape or a real error.
name of log file. Default ~/taper_log.
logging level (0 = no logging..4 = all). Default = 2.
When you select a directory in backup, it will calculate the directory size. This may take a while for big directories. Default.
No sizing of directories on selection. Quicker, but no indication of size of backup being contemplated.
specifies how many megabytes the log file should be at a maximum. If, after a taper operation, the log file is found to exceed this size, enough bytes are removed from the BEGINNING of the file to ensure the log file becomes number megabytes long. If this is 0, then no checking is done and the log file will continue to grow indefinitely. Default is 2.
level of overwrite
If the file exists on the hard disk, then it is not overwritten
If the file exists on the hard disk, it is only overwritten if the file on the backup device is more recent
The file on the hard disk is always overwritten
When doing unattended backups, if a tape contains unrecognized data, then if this option is set, then the tape is automatically overwritten.
When doing unattended backups, if a tape contains unrecognized data, then the tape is not overwritten - the backup is aborted and a message is mailed to the user. Default.
Name of preference file
Specifies the directory where temporary files are to be placed. Default is /usr/tmp.
Tells restore/backup to only show only volume 'num' in its window. Default is 0 which means show all volumes.
Quick fast forwards are enabled. See the section of Quick fast forwards for more details. Default is on for zftape and SCSI and off for ftape.
Disable quick fast forwards.
directory to restore to. Note that the directory structure of the backup is preserved
which directories to automatically exclude from the backup process. The string consists of a list of space separated directories. Note that the selection is recursive. For example, if you exclude list was "/tmp", the contents of /tmp will not be backed up. Also, none of the directories in /tmp (eg. /tmp/junk) will be backed up. Users of netscape may also want to put their cache directory on the exclude list ( /.netscape/cache) since this is where netscape stores its list of recently visited locations and is a waste to backup. Default is "tmp /usr/tmp /var/tmp"/.
remove number leading pathnames. When backing up, the full pathname is stored in the information file (and on the tape). You have the option of removing number leading paths when restoring. For example, if the file backed up was /home/yusuf/taper/README, by specifying -s 2, the file will appear in the restore menu as taper/README. If -s1 was specified, the file will appear as yusuf/taper/README.
If there are more strips than paths (eg. specifying -s 6 in the above example), then the filename only is used (eg. README).
The value -s 99 is a special value and tells restore to work out the optimum number of strips based on common leading paths
The default is -s 99 (ie. auto strip).
If this option is defined, then before taper erase a tape, it tries to set the block size using an ioctl call. This is mainly for the new zftape driver, but some SCSI drives need it. Default is on for zftape and off for others.
Do not try and set the block size before erasing a tape. Before any tape manipulation, it tries to set the block size using an ioctl call first. Also, before erasing a tape, it sets the block size.
Title of archive. Default is NULL. Only applicable when archive is being created for the first time. If supplied when doing an archive append, then it is ignored.
When doing a backup, only backup those files selected which are more recent than the files that are on the backup archive. Default.
When doing a backup, backup all files selected. This option can be overriden when selecting files for backup.
Gives the name of a file/directory to be backed up in unattended mode. If the filename begins with a @, then it is taken to be the name of a file set, otherwise, it is a file. If the first letter of the filename is a '!', then the file is excluded rather than selected. You can use as many -U as you like on the command line.
When doing a restore, restore the most recent file with the given filename. For example, if /etc/hosts has been backed up twice in different volumes, restore the file which is newer. Default.
When doing a restore, restore the file that was selected - for example, if you selected /etc/hosts in volume 1, this if the file that will be restored, even if there is an /etc/hosts in volume 2 which is more recent. This option can be overriden when selected files for restoration.
Using an archive created by taper version 5.6 or later. Default.
Using an archive created by a version less than 5.6.
prints version being used. Also prints the options taper was compiled with
when appending to a backup in unattended mode, if this value is not -1, then taper will check that the tape in the drive belongs to this archive ID before appending. If another archive is in the drive, then the backup will not be made. Default is -1.
The size of a block. Apart from the tape header, data is transferred to the tape device in blocks of 'num' size. The default is 28K. If you use a SCSI, see then note above. Num is in bytes. Note that this value MUST NOT exceed the size of DOUBLE_BUFFER in defaults.h.
Uses the ioctl eom to position to end of tape rather than fsf.
Uses multiple fsf to position to end of tape. Default.
Specifies the minimum amount of free disk space that must exist before a file is compressed. num is in kilobytes. Default is 4096K.
Turns on confirmation when selecting directories for backing up. Default.
Turns off confirmation when selecting directories for backing up
Tells taper the size of your tapes in megabytes. This must be the uncompressed size. Note that you must specify the same number every time you start taper. See notes on multiple tape backups for more details. If this value is 0, then taper auto-detects the end of tape. Default is 0 (auto-detect).
Select the backup option from the taper menu.
Four windows are displayed:
The top left represents the file system (hard disk) and you can move it using the arrow keys. To enter a directory, press ENTER when the highlight is on that directory. To include a file/directory in the backup, press 's'. Selecting a directory will select all the files in the directory recursively. To unselect a file/directory, press 'u'. If the file is only selected because it's directory is selected (eg. if you select /usr/john, then /usr/john/prefs is indirectly selected), then you must exclude the file/directory. Pressing 'e' will exclude the file/subdirectory from the backup. Pressing 'd' will show details about the file the highlight is on. Pressing 'j' will allow you to jump to a particular directory.
The top right window shows what is currently on the archive. You can use the arrow keys to move the display up/down. If the entry is in brackets, this means that this is an exclusion. If there is previous archive, you can move the arrow keys down to a file/directory and press 's' to select this entry.
The bottom left window shows the files that you have selected for backup. To unselect a file that you have selected for backing up, move the highlight to the file you wish to remove from the backup set and then press 'u'.
The bottom right window shows the files that you have excluded from the backup. If there is a '*' on the left of the entry, that means that this entry will cause some files to be excluded. If there is no '*', then none of the selections intersect with this exclusion.
Pressing TAB moves between the windows. Pressing 'h' will display a help screen. Pressing 'f' will finish selection and commence backup Pressing 'q' will abort backup
You can abort a backup by pressing q or Q while the backup is being made. This will cleanly stop backing up.
There are two modes for backup - full and incremental. The default incremental mode (which can be changed by changing the options, the preference file or command line). In incremental mode, when you select a file for backing up, taper looks at what is on the archive already. If the file you have selected for backup is more recent (or doesn't exist on the archive) than the one on the archive, it is backed up: if the file you have selected for backup is the same or older than the one on the archive, it is not backed up. For directories, taper checks each file in the directory recursively. To see if a file will be backed up, look at it's size in the selection (bottom) window - if it is zero, it means that taper will not back up that file.
In full mode, taper backups the file regardless of what's on the archive.
The backup mode can be changed for each file selection. Move the highlight in the selection window to the file you wish to change and then press 's'. To the left of the filename is an 'I' if the file is to be saved as incremental, or 'F' if it is full.
Select the restore option from the taper menu. If you have selected the 'prompt archives' option (default), then taper prints a list of all the archives it knows about and lets you select which one you would like to work with. The highlight will be automatically position on the archive that is in the tape drive (or which the regular file pertains to). Press ENTER to accept the archive or use the arrow keys to move around to select another archive. If the prompt archive option is not set, you will not be presented with this screen. Note that you are not allowed to change directories - ie. allowed to access other people's archives.
Three windows are displayed:
The top left window shows details of what is currently on the archive. You can move around using the arrow keys. To enter a directory, press ENTER when the highlight is on that directory. To select a file/directory for restoration, press 's'. Selecting a directory will select all the files in the directory recursively. Pressing 'd' will show details about the file the highlight is on. Pressing 'j' will allow you to jump to a particular directory.
The top right window shows how the archive was constructed (ie. what files/directories were selected for inclusion in the archive). An entry in brackets indicates that this was an exclusion. You can use the arrow keys to move the display up/down. You can press 's' when you are on a file or directory to select that particular file/directory.
The bottom window shows the files that you have selected for restoration. To unselect a file that you have selected for restoration up, move the highlight to the file you wish to remove from the restore set and then press 'u'.
Pressing TAB moves between the windows. Pressing 'h' will display a help screen. Pressing 'f' will finish selection and commence backup Pressing 'q' will abort backup
While the restore is in progress, you can stop it by pressing q or Q.
If taper cannot find an info file for the tape in the drive, then it offers you the option of doing a full restore. In full restore mode, all files on the archive are restored in all volumes. There is no pathname processing, so the full path is used relative to either the current directory, or the --restore-path option.
This comes in useful when you have backed up the same file several times (eg. as it has changed) and is the default mode. When you select a file for restoration, taper automatically selects the file which is on the latest volume (eg. you may have three volumes and /etc/passwd is on each. Even if you select the /etc/passwd in volume 1, taper will automatically select the volume 3 file, not the volume 1 file). This is indicated by an 'M' in the volume column of the selection window. Note that even if you are in a restricted volume view (using --only-vol), most recent restore will still automatically find the latest volume of your file on the archive.
In fixed volume mode, whichever file you select is the one that is restored (eg. in the example above, the /etc/passwd on volume 1 would be restored, despite the fact that the /etc/passwd on volume 3 is more recent).
To toggle between fixed volume & most recent mode for a particular file selection, press 's' when on the selected file in the selection window.
Select the recreate info file option from the taper menu.
This recreates archive information files given an archive. It also checks that the checksums of all the files are valid. Any errors are printed to the log file.
Basically, it looks for an archive on the devices given. It prints the archive ID and archive title on the screen, then prints each file as it passes it while recreating the archive information file in the directory specified. Because it has to traverse the whole archive, it does take some time to recreate the information file.
As it is traversing, mkinfo checks the checksums of the files on the archives and writes any errors to the log file. Thus, you can check the integrity of your archives with mkinfo.
If taper encounters a bad checksum, you have the option of trying to continue the mkinfo or you can tell taper to assume that this is the end of the backup. This is useful if a backup got killed by a power failure or something.
During the traverse, you can press q or Q to stop it. If you do that, you will corrupt your info file and you will have to re-run mkinfo to restore your info file.
Mkinfo may return errors when trying to advance to volumes that do not exist. Do not worry about this - just select abort and the info file will be correctly constructed.
This option goes through an archive and checks that what's on the archive matches what is on the hard disk, byte by byte. If a file is on the archive but not on the disk, it is ignored. Any discrepancies are printed to the log file. It also checks the checksums and if a bad checksum is encountered, like mkinfo, you have the option of trying to continue or to assume that the rest of the backup is bad.
This prepares a tape for use by taper. This is not needed by zftape or ftape tape drives. Some SCSI drives need this.
This tests whether your tape drive needs to have make tape run on new tapes. It is important that a BRAND NEW tape is used when running this test - ie. one that has never seen the inside of your (or anyone else's) tape drive before.
Tells you on which device your /proc filesystem is mounted. Type in the name of your /proc directory (usually /proc) and then taper will give you a device number. This is then fed to taper using the --proc-device (or -J) option. The default is 1.
Some tape drives can quickly advance between volumes on the tape. This also quicker restoration of files from multiple volumes. Use this utility to see if your tape drive can use fast fsf.
Taper can use the seek ioctl to make seeking for files in restore a lot quicker. Basically, the block on which the file should lie is calculated and then a seek is issued to quickly advance the tape drive to this block. However, your tape drive must support the seek ioctl for this to happen.
You can use this utility to check if your tape drive supports the seek ioctl.
Before using test can seek you must ensure that you have the correct setting for test fast fsf.
According to BSD semantics, when a program requests a further read from a tape when at the end of the tape, it should return either a 0 error or a -1 error with errno set at ENODATA or ENOSPC.
Some tape drives do not do this, but return an I/O error which means that taper doesn't know whether an end of tape is reached or a true I/O error is encountered.
Therefore, this utility will check to see if your tape drive handles the end of tape condition legally. If it does, well and good.
If it doesn't, taper assumes that I/O errors are really end of tapes. The problem, of course, is that we don't know when true I/O errors occur. There is no solution to this problem other than finding a compliant tape drive.
Lets you erase that last `n' volumes on an archive. Tell taper the number of volumes you wish to delete. Taper then deletes these volumes. Note that once a volume is deleted, it cannot be restored.
To speed up access, the info file cluster contains a couple of index files. These files are arranged as m-tree indexes. Occasionally, these index files can get corrupted. If you think this has happened, you can reindex the files.
Also, if you want to restore your files onto a different machine, and do not want to recreate the info files on that machine, you can take a copy of the info files to the new machine. Rather than taking all four of them, you can take the two main files, and rebuild the indexes using this option, on the new machine.
It is possible on some systems that you have recursive links. For example, you may have a soft link that points to "./". This leads to a recursive situation which does not matter if you do not follow links.
If you follow links (via the soft-links option), then taper will crash as it encounters this link. Running this utility identifies any recursive links you may have so that you can either tell taper not to use hard links, or so you can remove the offending link.
Just enter the starting directory you wish to test - taper will look for recursive links and tell you if you have any. In some situations, taper will seg fault at the link. This is not a problem since you will know where the offending link is by when it seg faults.
If you have an archive that is corrupted, you can try to tell taper to start recovery at a point beyond the corruption. The hardest thing is to try an get taper back in sync at a point beyond the corruption.
An archive looks like:
tape header
volume header
file header ) repeated for each file
file ) in the archive
Once a corruption occurs, you have to find the file header of the first file beyond the corruption and tell taper where it is and then taper can continue to recover files.
In this utility, you tell taper where you want to start the restore (in bytes relative to the beginning of the archive). Taper will then print the filename and file header for confirmation. If you get garbage here, then you are not positioned on the file header and you must continue trying until you are.
Once you are correctly positioned, say YES and taper will try and recover files beyond the corruption point.
The easiest way to find the correct position is to use an editor such as midnight commander to scan the file until you can locate the correct location.
If you are using a tape drive (especially on a volume other than the first), it is a good idea to read the tape data into a disk file using dd and then work with the file, rather than the tape. It is just quicker.
If you are trying to recover data from a volume other than the first one, you must position the tape (using the non-rewinding device) on the volume you wish to recover from, read the tape data into a disk file and then work on this disk file.
When you are working with the disk file, start taper using the -T l preference.