tar(1)
_________________________________________________________________
tar Command
tape file archiver
_________________________________________________________________
SYNTAX
tar [ key ] [ files ]
DESCRIPTION
Tar saves and restores files on magnetic tape. Its actions are
controlled by the key argument. The key is a string of
characters containing at most one key function letter and
possibly one or more function modifiers. 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.
Key function letters are:
r The named files are written on the end of the tape. The
c function implies this function.
x 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.
If the named file on tape does not exist on the system,
the file is created with the same mode as the one on
tape; but the set-user-ID and set-group-ID bits are not
set unless you are super-user.
If the files exist, their modes are not changed except
for the bits described above. The owner, group, and
modification time are restored (if possible). If no
files argument is given, the entire contents of the tape
are extracted. Note that if several files with the same
name are on the tape, the last one overwrites all earlier
ones.
t The names of all the files on the tape are listed.
u The named files are added to the tape if they are not
already there, or have been modified since last written
on that tape.
c Create a new tape; writing begins at the beginning of the
tape, instead of after the last file. This command
DG/UX 4.00 Page 1
Licensed material--property of copyright holder(s)
tar(1)
implies the r function.
h Dump the resolution files of symbolic links, instead of
the links themselves. When tar encounters a symbolic
link to a directory, it dumps the contents of the
directory.
You can use the following function modifiers in addition to the
letter that selects the desired function. Function modifiers
used with the key letter that selects the desired function are:
v Normally, tar does its work silently. The v (verbose)
option causes it to type the name of each file it treats,
preceded by the function letter. With the t function, v
gives more information about the tape entries than just the
name.
w Prints the action to be taken, followed by the name of the
file, and then waits for the user's confirmation. If the
first character of your input is y, the action is performed.
Any other input means "no".
f Uses the next argument as the name of the archive instead of
the default (/dev/rmt/0. in DG/UX. 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 Uses the next argument as the blocking factor for tape
records. The default is 1, the maximum is 32 for reel tape,
16 for cartridge tape. Use this option only with raw
magnetic tape archives (see f above). The block size is
determined automatically when reading tapes (using options
or x or t).
l Tells tar to complain if it cannot resolve all of the links
to the files being dumped. If l is not specified, no error
messages are printed.
m Tells tar not to restore the modification times. The
modification time of the file will be the time of
extraction.
DG/UX only
o Causes extracted files to take on the user and group
identifier of the user running the program rather than those
on the tape.
#s Where # is a tape drive number (0,...,7), and s is the
DG/UX 4.00 Page 2
Licensed material--property of copyright holder(s)
tar(1)
density (l-- low (800 bpi), m --medium (1600 bpi), or h --
high (6250 bpi)). This option specifies the drive on which
the tape is mounted. The default is 0m.
_________________________________________________________________
EXAMPLES
$ tar xv file1 file2
a file1 48 blocks
a file2 64 blocks
This command causes file1 and file2 to be read from the default
tape device (/dev/rmt/0). The files are listed as they are read
from tape.
$ tar cvf /dev/rmt/c22d0 input1 input2
a input1 63 blocks
a input2 47 blocks
This command causes input1 and input2 to be written to the tape
on device /dev/rmt/c22d0. The files are listed as they are
written to the archive file. If /dev/rmt/c22d0 had been a
filename instead of a tape device, the archive output would have
been a filename instead of a tape device, the archive output
would have been to that file.
tar tvf output
rwxr-xr-x3000/1 31908 NOV 12 09:32 1987 input1
rwxr-xrwx3000/1 24064 NOV 11 14:26 1987 input2
This command causes all of the files on the archive file (output)
to be listed.
_________________________________________________________________
FILES
/dev/mt/*
DIAGNOSTICS
Complains about bad key characters and tape read/write errors.
Complains if enough memory is not available to hold the link
tables.
Detects end-of-file and short block errors when reading tar
DG/UX 4.00 Page 3
Licensed material--property of copyright holder(s)
tar(1)
archived tapes. Reports the errors and attempts to finish
reading the tape.
BUGS
There is no way to ask for the nth occurrence of a file.
Tape errors are handled ungracefully.
The u option can be slow.
The b option should not be used with archives that are going to
be updated. If the archive is on a disk file, the b option
should not be used at all, because updating an archive stored on
disk can destroy it.
The current limit on filename length is 100 characters.
Note that tar c0m is not the same as tar cm0.
DG/UX 4.00 Page 4
Licensed material--property of copyright holder(s)