Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ tar(1) — CX/UX 6.20

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ar(1)

cpio(1)

ls(1)

tar(4)

umask(2)

tar(1)

NAME

tar − tape file archiver

SYNOPSIS

/usr/bin/tar −c[vwfbLkFhieAU[#s]] device block tapesize incfile files . . .
/usr/bin/tar −c[vwfbLkXhieAU[#s]] device block tapesize excfile files . . .
/usr/bin/tar −r[vwfbLkFhieAU[#s]] device block tapesize incfile files . . .
/usr/bin/tar −r[vwfbLkXhieAU[#s]] device block tapesize excfile files . . .
/usr/bin/tar −t[vfLXie[#s]] device excfile [files . . .]
/usr/bin/tar −u[vwfbLkXhieAU[#s]] device block tapesize excfile files . . .
/usr/bin/tar −u[vwfbLkFhieAU[#s]] device block tapesize incfile files . . .
/usr/bin/tar −x[lmovwfLXpieA[#s]] device excfile [files . . . ]

DESCRIPTION

tar saves and restores files on magnetic tape.  Its actions are controlled by a string of characters containing one option (c, r, t, u, or x), and possibly followed by one or more modifiers (v, w, f, b, L, k, F, X, h, i, e, A, U, l, m, o, p, and #s).  Other arguments to the command are files (or directory names) specifying which files are to be dumped or restored. In all cases, appearance of a directory name refers to the files and (recursively) subdirectories of that directory.

This release of tar complies with the extended tar format specified by the POSIX 1003.1 standard as well as the X/Open standard.  Extended tar format permits the archiving and extracting of FIFO, character special and block special files as well as regular, directory, linked, and symbolic linked files.  The extended tar format requires additional fields in the tar header created for each file archived [see tar(4)].  All archives created by tar will be done so using the extended tar format. 

The options are as follows:

-c Create a new tape; writing begins at the beginning of the tape, instead of after the last file.  The -c option implies the -r option. 

-r Replace.  The named files are written on the end of the tape. The -c and -u options imply the -r option.  This option is not valid on cartridge tape devices.  For cartridge tape devices, the -c option (see above) must be used instead [see gt(7)]. 

-t Table.  The names and other information for the specified files are listed each time that they occur on the tape.  The listing is similar to the format produced by the ls -l command [see ls(1)].  If no files argument is given, all the names on the tape are listed.

-u Update.  The named files are added to the tape if they are not already there, or have been modified since last written on that tape. The -u option implies the -r option.  This option is not valid for use with cartridge tape devices.  For cartridge tape devices, the -c option (see above) must be used instead [see gt(7)].  Do not use this option to append files to an archive created by a previous release of this utility and vice versa. 

-x Extract.  The named files are extracted from the tape. If a named file matches a directory whose contents had been written onto the tape, this directory is (recursively) extracted. Use the file or directory’s relative path when appropriate, or tar will not find a match.  If a named file on tape does not exist on the system, the file is created with the same mode as the one on tape except that the set-user-ID and set-group-ID bits are not set unless you are super-user (see the -p option below also).  If the files exist, their modes are not changed except for the bits described above.  The owner, modification time, and mode are restored (if possible).  If no files argument is given, the entire contents of the tape is extracted. Note that if several files with the same name are on the tape, the last one overwrites all earlier ones.

The modifiers below may be used in the order shown in the synopsis. 

#s This modifier determines the drive on which the tape is mounted (replace # with the drive number (0,...,7)) and optionally, the density of the drive (replace s with l (800 bpi), m (1600 bpi), or h (6250 bpi) for low, medium or high).  The use of this modifier tells tar to use the drive /dev/rmt/#s other than the default drive (defaults are listed in /etc/default/tar), or the drive specified by the TAPE environment variable (see the NOTES section below).  If a single drive number (#) is detected without a proceeding density modifier (s), tar will assume usage of the /etc/default/tar file.  When using this file, tar will use the drive number specified by "#" and attempt to find a matching "archiveX=" entry in this file where "X" represents a number in the range 0-7.  If the given drive number matches an "archive" number in the /etc/default/tar file, then the device or file specified by that entry as well as its specified blocking factor and volume size is used.  Use of the #s modifier can be overridden if the f modifier is specified as well with a valid device entry.  Note that if this case occurs, the blocking factor and volume size specified by the /etc/default/tar entry will remain in effect, unless overridden by values accompanying the b and s options described below.  If none of the device modifiers described above are included in the option line to tar, it will use the /etc/default/tar entry "archive0" as the default device. 

v Verbose.  Normally, tar does its work silently.  The v (verbose) modifier causes it to print the name of each file it treats, preceded by the option.  With the -t option, v gives more information about the tape entries than just the name. 

w What.  This modifier causes tar to print the action to be taken, followed by the name of the file, and then wait for your confirmation.  If a word beginning with y is given, the action is performed.  Any other input means no.  This is not valid with the -t option. 

f File.  This causes tar to use the device argument as the name of the archive instead of the default.  If the name of the file is −, tar writes to the standard output or reads from the standard input, whichever is appropriate.  If writing or reading from standard output or standard input, tar defaults to a blocking factor of 1 and will not accept any other blocking factor.  tar can be used as the head or tail of a pipeline.  tar can also be used to move hierarchies with the command:

cd fromdir; tar cf - . | (cd todir; tar xf −)

b Blocking Factor.  This modifier causes tar to use the block argument as the blocking factor for tape records.  The default is 20.  This modifier should not be supplied when operating on regular archives or block special devices.  It is mandatory however, when reading archives on raw magnetic tape archives (see f above).  The block size is determined automatically when reading tapes created on block special devices (options x and t). 

l Link.  This modifier causes tar to complain if it cannot resolve all of the links to the files being dumped.  If the l modifier is not specified, no error messages are printed. 

m Modify.  This modifier causes tar to not restore the modification times.  The modification time of the file will be the time of extraction. 

o Ownership.  This modifier causes extracted files to take on the user and group identifier of the user running the program, rather than those on tape.  This is only valid with the -x option. 

L Follow symbolic links.  This modifier causes symbolic links to be followed.  By default, symbolic links are not followed. 

k This modifier uses the tapesize argument as the size in kilobytes per volume.  A value of 0 for tapesize causes multi-volume mode to be disabled (interpreted as an infinite volume size).  The minimum non-zero value permitted is 250 (which equates to 500 512-byte blocks).  This modifier may be used with the -c, -r, and -u options. 

F This modifier uses the incfile argument as a file containing a list of named files (or directories) to be included on the tape.  Each incfile entry consists of a single line containing the name of an individual file or directory.  This modifier may only be used with the -c, -r, and -u options.  This modifier may not be used with the X modifier. 

X This modifier uses the excfile argument as a file containing a list of named files (or directories) to be excluded.  Each excfile entry consists of a single line containing the name of an individual file or directory.  This modifier may not be used with the F modifier. 

h This modifier causes tar to follow symbolic links as if they were normal files or directories.  Normally tar does not follow symbolic links.  The h modifier may be used with the -c, -r, and -u options. 

p This modifier restores the named file arguments to their original modes, ignoring the present value returned by umask [see umask(2)].  setuid and sticky bit information are also restored if the effective user ID is root.  This modifier may only be used with the -x option. 

i This modifier causes tar to ignore directory checksum errors. 

e This modifier causes tar to quit when certain minor errors are encountered.  Otherwise tar will continue when minor errors are encountered. 

A This modifier causes absolute pathnames for files to be suppressed, and may be used with the -r, -c, -u, and -x options.  This causes all pathnames to be interpreted as relative to the current working directory. 

U This modifier is a CX/UX extension that allows archives created with this version of tar to be read by versions of tar distributed by the University of California at Berkeley (UCB) on other systems.  UCB versions of tar have historically appended a slash (/) by default to all directory names archived.  UCB tar uses the / to determine whether a directory is to be extracted from the archive.  The CX/UX version of tar does not append a / by default to all directory names because this is not permitted in the POSIX 1003.1 or X/Open extended tar format.  Usage of this modifier will permit the appending of the / to all directory names archived.  Any archives created via this modifier by this version of tar can be read by UCB versions of CX/UX tar released prior to CX/UX 5.3.  This modifier can be used only with the -r, -c, and -u options. 

FILES

/dev/rmt/∗
/etc/default/tar
/tmp/tar∗
/usr/lib/locale/locale/LC_MESSAGES/uxcore language-specific message file [See LANG on environ(5).]

SEE ALSO

ar(1), cpio(1), ls(1), tar(4), umask(2). 

DIAGNOSTICS

Complains about tape read/write errors. 
Complains if insufficient memory is available to hold the link tables.

NOTES

There is no way to ask for the n-th occurrence of a file. 

The b modifier should not be used with archives that are going to be updated.  The current magnetic tape driver cannot backspace raw magnetic tape.  If the archive is on a disk file, the b modifier should not be used at all, because updating an archive stored on disk can destroy it. 

The current limit on file name length is 100 characters. 

The current limit on a file name prefix (i.e., directory prefix) is 155 characters.  If a file name contains a prefix and the total length (prefix + file name) is less than or equal to 100 characters, the total name will be stored in the file name portion of the tar archive header. 

The current limit on a linked name (symbolic or hard) is 100 characters.  This limit includes any path names relative to the links being archived. 

Note that tar c0m is not the same as tar cm0. 

This release of tar can read archives created in either non-extended or extended format by pre-CX/UX 6.1 releases of tar. 

Setting the TAPE environment variable to an archive device or file name will cause tar to use the device or file specified as its default archive device.  Thus, using this variable does not require use of the f or #s device modifiers with tar.  The value of this variable can be overridden if either of the two device modifiers previously described are used as an option to tar instead. 

The -u option can be slow. 

Tape errors are handled ungracefully. 

CX/UX permits blocked archives to be updated.  It is recommended that the default blocking factor of 20 be used for archives which must be created and updated on CX/UX systems.  Other implementations of tar may not permit this or may expect the blocking factor of such an archive to be 1.  Therefore if the archive created on a CX/UX system may be transported to a non CX/UX system for possible update, it should be created with a blocking factor of 1.  Pre-CX/UX 6.1 releases of tar set the default blocking factor of tape (character special) archive devices to 20 and those of non-character special archive devices (e.g., files) to 16. 

When using multi-volume mode, the maximum number of extents across which a file may be split and stored is 9. 

CX/UX User’s Reference Manual

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