TAR(1-SVR4) RISC/os Reference Manual TAR(1-SVR4)
NAME
tar - tape file archiver
SYNOPSIS
/usr/svr4/usr/bin/tar -c[vwfbLkFhienA[#s]] device block files tapesize incfile . . .
/usr/svr4/usr/bin/tar -c[vwfbLkXhienA[#s]] device block files tapesize excfile . . .
/usr/svr4/usr/bin/tar -r[vwfbLkFhienA[#s]] device block files tapesize incfile . . .
/usr/svr4/usr/bin/tar -r[vwfbLkXhienA[#s]] device block files tapesize excfile . . .
/usr/svr4/usr/bin/tar -t[vfLXien[#s] device [files . . .] excfile
/usr/svr4/usr/bin/tar -u[vwfbLkXhienA[#s]] device block files tapesize excfile . . .
/usr/svr4/usr/bin/tar -u[vwfbLkFhienA[#s]] device block files tapesize incfile . . .
/usr/svr4/usr/bin/tar -x[lmovwfLXpienA[#s]] device [files . . . ] excfile
DESCRIPTION
tar saves and restores files on magnetic tape. Its actions
are controlled by a string of characters containing one
function letter (c, r, t, u, or x), and possibly followed by
one or more function modifiers (v, w, f, b, L, k, F, X, h,
i, e, n, A, 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, appear-
ance of a directory name refers to the files and (recur-
sively) subdirectories of that directory.
The function letters are as followings:
-c Create a new tape; writing begins at the beginning
of the tape, instead of after the last file. This
function letter implies the r function letter.
-r Replace. The named files are written on the end of
the tape. The c and u function letters imply this
function letter.
-t Table. The names and other information for the
specified files are listed each time they occur on
the tape. The listing is similar to the format pro-
duced 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. This function
letter implies the r function letter.
-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 direc-
tory is (recursively) extracted. Use the file or
directory's relative path when appropriate, or tar
will not find a match. The owner, modification
time, and mode are restored (if possible). If no
files argument is given, the entire content of the
tape is extracted. Note that if several files with
the same name are on the tape, the last one
Printed 11/19/92 Page 1
TAR(1-SVR4) RISC/os Reference Manual TAR(1-SVR4)
overwrites all earlier ones.
The characters below may be used in addition to the letter
that selects the desired function. Use them in the order
shown in the synopsis.
#s This modifier determines the drive on which the tape
is mounted (replace # with the drive number) and the
speed of the drive (replace s with l, m, or h for
low, medium or high). The modifier tells tar to use
a drive other than the default drive, or the drive
specified with the f function modifier. For exam-
ple, with the 5h modifier, tar would use /dev/mt/5h
or /dev/mt0 instead of the default drives /dev/mt/0m
or /dev/mt0, respectively. However, if for example,
-f /dev/rmt0 5h appeared on the command line, tar
would use /dev/rmt5h or /devmt0. The default entry
is 0m.
v Verbose. Normally, tar does its work silently. The
v (verbose) function modifier causes tar to echo to
the screen, the name of each file it treats, pre-
ceded by the function letter. With the t function
letter, v gives more information about the tape
entries than just the name.
w What. This 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 func-
tion letter.
f File. This causes tar to use the device argument as
the name of the archive instead of /dev/mt/0m or
/dev/mt0. If the name of the file is -, tar writes
to the standard output or reads from the standard
input, whichever is appropriate. Thus, 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 causes tar to use the block
argument as the blocking factor for tape records.
The default is 1, the maximum is 20. This function
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 the f function modifier, above). The
block size is determined automatically when reading
tapes created on block special devices (function
letters x and t).
l Link. This tells tar to complain if it cannot
resolve all of the links to the files being dumped.
Page 2 Printed 11/19/92
TAR(1-SVR4) RISC/os Reference Manual TAR(1-SVR4)
If l is not specified, no error messages are
printed.
m Modify. This tells tar to not restore the modifica-
tion times. The modification time of the file will
be the time of extraction.
o Ownership. This 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 function letter.
L Follow symbolic links. This causes symbolic links
to be followed. By default, symbolic links are not
followed.
k This function modifier uses the tapesize argument as
the size in bytes per volume for non-tape devices
(such as a floppy drive). A value of 0 for tapesize
causes multi-volume mode to be disabled (interpreted
as an infinite volume size). This function modifier
may be used with the c, r, and u function letters.
F This function modifier uses the incfile argument as
a file containing a list of named files (or direc-
tories) to be included on the tape. This function
modifier may only be used with the function letters
c, r, and u. This function modifier may not be used
with the X function modifier.
X This function modifier uses the excfile argument as
a file containing a list of named files (or direc-
tories) to be excluded, and may be used with all
function letters. This function modifier may not be
used with the F function modifier.
h This function modifier causes tar to follow symbolic
links as if they were normal files or directories.
Normally tar does not follow symbolic links. The h
function modifier may be used with the function
letters c, r, and u.
p This function modifier restores the named file argu-
ments to their original modes, ignoring the present
value returned by umask [see umask(2) in the
Programmer's Reference Manual]. setuid and sticky
bit information are also restored if the effective
user ID is root. This function modifier may only be
used with the x function letter.
i This function modifier causes tar to ignore direc-
tory checksum errors.
e This function modifier causes tar to quit when cer-
tain minor errors are encountered. Otherwise tar
will continue when minor errors are encountered.
n This function modifier must be used when the device
argument is for a non-tape device (for example, a
floppy drive).
A This function modifier causes absolute pathnames for
files to be suppressed, and may be used with the r,
c, u, and x function letters. This causes all
Printed 11/19/92 Page 3
TAR(1-SVR4) RISC/os Reference Manual TAR(1-SVR4)
pathnames to be interpreted as relative to the
current working directory.
FILES
/dev/mt/*
/dev/mt*
/dev/mt/ctape
/dev/mt/0m
/dev/rmt/0m
/tmp/tar*
DIAGNOSTICS
Complains about bad key characters and tape read/write
errors.
Complains if enough memory is not available to hold the link
tables.
NOTES
There is no way to ask for the n-th occurrence of a file.
Tape errors are handled ungracefully.
The u function modifier can be slow.
The b function 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 function 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.
tar doesn't copy empty directories or special files.
SEE ALSO
ar(1), cpio(1), ls(1).
umask(2) in the Programmer's Reference Manual].
Page 4 Printed 11/19/92