Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

mdtar(1)

mt(1)

tar(5)

tar(1)

Name

tar − multivolume archiver

Syntax

tar [key] [name...]

Description

The tape archiver command, tar, saves and restores multiple files to and from a single archive. The default archive device is /dev/rmt0h, but any file or device may be requested through the use of options.

The key is a string of characters containing at most one function letter and possibly names specifying which files to dump or restore.  In all cases, appearance of a directory name refers to the files and (recursively) subdirectories of that directory. 

This utility supports EOT handling which allows the use of multiple media.  The utility prompts for the next volume when it encounters the end of the current volume. 

This utility supports the TA90 style sequential stacker loader device.  The device ejects a cartridge when it is taken off line.  This utility performs the device ejection on behalf of the user when it encounters a multivolume boundary during write or read operations involving tape.  The device then automatically loads the next available tape (if there is one).  The utility then attempts to access this next tape for a reasonable amount of time (approximately three minutes) before prompting the user for a manual reload operation. 

Function Keys

The function portion of the key is specified by one of the following letters:

c Create a new archive on tape, disk or file.  Writing starts at the beginning of the archive instead of after the last file. 

r Write the named files to the end of the archive. 

t List the names of the files as they occur on the input archive. 

u Add the named files to the archive if they are not there already or if they have been modified since they were last put in the archive. 

x Extract the named files from the archive.  If the named file matches a directory whose contents had been written into the archive, the directory is recursively extracted.  The owner, modification time, and mode are restored, if possible.  If no file argument is given, the entire content of the archive is extracted.  Note that if multiple entries specifying the same file are in the archive, the last one overwrites all previous versions extracted. 

Options

You can use one or more of the following options in addition to the letter which selects the function desired:

0...9 Substitute number for the device unit number as in /dev/rmt#h. The default is the high density rewind tape device number zero named /dev/rmt0h. The following tar command uses device /dev/rmt4h:

% tar cv4 tar.c

A Use next argument as archive number with which to begin output. 

B Force input and output blocking to 20 blocks/record.  This option allows tar to work across a communications channel where the blocking may not be maintained.

D Directory output in original tar style.

C Use to perform a directory change prior to archiving data. 

F[ F ] Operate in fast mode .  When F is specified, tar skips all SCCS directories, core files, and error files. When FF is specified, tar also skips all a.out and *.o files. 

H Help mode.  Print a summary of the function keys and options. 

L Permits the program to treat the tape drive as a sequential loader device even though it is not represented as such in the system driver tables. 

M Next argument specifies maximum archive number to be written and prints current archive number on output line. 

N No multi-archive, file splitting, or new header format on output.  Output directories in previous tar format. On input, set file UID and GID from file header vs. values in /etc/passwd and group files.

O Include file owner and group names in verbose output (t and x functions) if present in archive header.  Output warning message if owner or group name not found in /etc/passwd or /etc/group file (cru functions).

P Used to specify POSIX format tapes.  Necesary only with the c key. 

R Each named file contains a list of file names separated by newlines which is added to (c function key) or extracted from (x function key) the archive. 

S Output User Group Standard archive format. 

V Display extended verbose information.  Included are the version number of tar, the number of blocks used on the device, the number of blocks in a file, and the protection modes given in a format similar to the ls −l command.  In addition to this information, V provides the information given by the v option. 

b Use the next argument as the blocking factor for tape records.  The default is 20 (the maximum is 127).  This option should only be used with raw magnetic tape archives (see the f option).  This option is unnecessary when reading tapes (x and t keys).  See the Restrictions section. 

d Use /dev/rra1a as the default device. The mdtar command is recommended for use with floppy disks.

f Use the next argument as the name of the archive instead of /dev/rmt0h. If the name of the file is − , tar writes to standard output or reads from standard input, whichever is appropriate. Thus, tar can be used as the head or tail of a filter chain. You can also use tar to move hierarchies. The following example shows how to move the directory fromdir to the directory todir:

# cd fromdir; tar cf − . | (cd todir; tar xpf −)

h Save a copy of the actual file on the output device under the symbolic link name, instead of placing the symbolic information on the output.  The default action of tar is to place symbolic link information on the output device. A copy of the file itself is not saved on the output device.

i Ignore checksum errors found in the archive. 

l Complain if tar cannot resolve all of the links to the files dumped. If this is not specified, no error messages are printed.

m Do not restore the modification times.  The modification time is the time of extraction.  Tar normally restores modification times of regular and special files. 

o Suppress the normal directory information.  On output, tar normally places information specifying owner and modes of directories in the archive.  Former versions of tar, when encountering this information will give error message of the following form:

<name>/: cannot create

The tar command will place information specifying owner and modes of directories in the archive.

p Restore the named files to their original modes, ignoring the present umask(.). Setuid and sticky bit information is also restored to the superuser.

s Next argument specifies size of archive in 512 byte blocks. 

v Write the name of each file treated, preceded by the function letter, to diagnostic output.  Normally, tar does its work silently. With the t function key, the verbose option provides more information about the tape entries than just their names. 

#cd /
#tar cvf tar-out vmunix

The preceeding command produces the output “a vmunix 1490 blocks” where 1490 is the number of 512 byte blocks in the file “vmunix”.

#tar xvf tar-out

The proceeding command produces the output “x vmunix, 762880 bytes, 1490 blocks” where 762880 is the number of bytes and 1490 is the number of 512 byte blocks in the file “vmunix” which was extracted.

w Print the action to be taken, followed by file name, then wait for user confirmation.  If a word beginning with the letter y is given, the action is done.  Any other input means do not do it. 

Restrictions

The p option fails to ignore umask when extracting a file that has been archived by the DEC/OSF 1 tar command.  Use pxtar to work around the limitation.

There is no way to ask for the nth occurrence of a file. 

Tape errors are handled ungracefully. 

The u key can be slow. 

The limit on file name length is 100 characters. 

There is no way to follow symbolic links selectively. 

On SCSI tape devices tar (when reading) may end on one volume of a multivolume set without prompting for the next volume. This is a very infrequent condition. The next volume should be loaded and the command issued again. 

Using a blocking factor other than the default (b option) may lead to higher performance.  However, you must select a value that is compatible with the hardware limitations of the source and destination machines.  Software limitations may apply for other versions of tar.

When extracting (x), tar reads the entire tape. See the r and u keys. 

The u and the r function keys do not operate with quarter-inch tape cartidge drives such as the TZK10. 

ULTRIX tar, due to BSD coding, does not completely fill a flexible disc in multivolume situations.

In multivolulme situations, ULTRIX tar employs the following header rules for volume-spanning files.  At the beginning of the next volume, a second header is written that includes both the full size of the file and the size of the file segment that is written on the second volume. The first header states the full size of the file only.  These rules may not be compatible with other systems’ versions of tar.

Examples

To archive files from /usr/include and /etc, type:

# tar c −C /usr/include . −C /etc .

The tar command can properly handle blocked archives.

Diagnostics

The tar command produces diagnostics when it encounters bad key characters, read/write errors and when there is not enough memory available to hold the link tables.

Files

/dev/rmt0h
/dev/rra1a
/tmp/tar*

See Also

mdtar(1), mt(1), tar(5)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026