Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ tar(1) — A/UX 3.0.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ar(1)

cpio(1)

dd(1)

tp(1)

dump.bsd(1M)

tar(4)




tar(1) tar(1)
NAME tar - copies files to or from a tar archive SYNOPSIS tar [-]c[0...7[density]][ilvbBdfs] [bBdfs-arg]... file... tar [-]r[0...7[density]][ilvbBdfs] [bBdfs-arg]... file... tar [-]t[0...7][ivw][f archive] [file-in-archive]... tar [-]u[0...7[density]][ilvbBdfs] [bBdfs-arg]... file... tar [-]x[0...7][timovw[f archive] [file-in-archive]... ARGUMENTS 0...7[density] Selects a tape drive, where a digit between 0 and 7 is the drive number corresponding to a 9-track tape drive and density is the density to be established: -l low (800 bpi) -m medium (1600 bpi) -h high (6250 bpi) The default is 0m (drive number 0 at 1600 bpi). Note that the drive number is unrelated to SCSI ID numbers. The command option that can be used to select a particular SCSI device is -f (described later in this list). -b (-c, -r, -u modes) Lets you specify the blocking factor for tape records as one of the supplied bBdfs-arg values. The default value is 1, the maximum is 20. This command option should only be used with raw magnetic tape devices (see the -f option). The block size is determined automatically when reading tapes. -B (-c, -r, -u modes) Lets you specify the number of 512-byte blocks that fit on the media as one of the supplied bBdfs-arg values. This permits tar to correctly issue prompts requesting insertion of additional media during lengthy archival January 1992 1



tar(1) tar(1)
operations. bBdfs-arg (-c, -r, -u modes) Specifies one of the arguments associated with the -b, -B, -d, -f, or -s command options. Note that these values are detached from their associated command options. However, they must be entered in an order that matches the order of the related command options. For more information regarding legal replacement values, refer to each of the specific command options elsewhere in this alphabetical list. -c Creates a new archive, overwriting any old information within an archive. -d (-c, -r, -u modes) Lets you specify the tape's density as one of the supplied bBdfs-arg values. The default value is 1600 (BPI). -f Lets you specify the archive file or device as one of the supplied bBdfs-arg values. The default value is /dev/mt/0m. If the value is given as -, tar writes to the standard output or reads from the standard input, in accordance with other command options. Thus, tar may be used at the head or the tail of a command pipeline as shown in ``Examples.'' file (-c, -r, -u modes) Specifies what to archive in terms of a file or directory. If a directory is specified, the contents of it (including nested directories and files) are archived. Note that tar does not follow symbolic links properly, but that it does correctly handle hard file links. file-in-archive (-t mode) Specifies what to list from an archive in terms of one or more exactly-matching filenames (or pathnames) that you know are located inside an archive and that you wish to be displayed (see the other options for use when retrieving files from archives, -m and -o). file-in-archive (-x mode) Specifies what to retrieve from an archive in terms of 2 January 1992



tar(1) tar(1)
one or more exactly-matching filenames (or pathnames) of files that are located inside an archive and that you wish to retrieve. If the file named matches a directory whose contents had been written into archive, this directory is (recursively) extracted. If a named file from within archive does not exist on the system, the file is created with the same mode as in the archive, except that the set-user-ID and set-group-ID bits are not set unless you are superuser. If the file exists, its permissions are not changed except for the bits described above. The owner, group, and modification time are restored (if possible). If no file-in-archive arguments are given, the entire content of archive is extracted. Note that if several files with the same name are on the tape, the last one overwrites all earlier ones. -i Establishes the preference to ignore symbolic links (see related information within ``Limitations''). -l (-c, -r, -u modes) Establishes the preference to report error messages if links cannot be followed, causing certain data to be skipped. If -l is not specified, no error messages are printed. -m (-x mode only) Establishes new modification times for files retrieved from an archive rather than preserving the original modification dates and times. The modification time of the file will be the time of extraction. -o (-x mode only) Establishes the user ID and group ID for retrieved files as those of the user running the program rather than those recorded when the archive was created. -r Appends archive data onto an existing archive rather than overwriting and destroying the previous archive. This command mode may not work on all devices because it requires the ability to perform ``seek'' operations within the media. -s Lets you specify the tape's length in feet as one of the supplied bBdfs-arg values. This value together with the density allows tar to calculate when the end of the tape is reached, so that it can prompt for another tape in a sequence of tapes. The default length is 2300 feet. January 1992 3



tar(1) tar(1)
-t Displays the contents of an archive without copying any files out of it. -u Appends to an archive conditionally, adding files to the archive file or device (see the -f option) only if they are not already there or have been modified since last written on that archive. -v Establishes a preference to provide regular feedback about the work underway. Normally, tar does its work without displaying progress messages. The -v (verbose) option causes it to type the name of each file it treats, preceded by the function letter. When used along with the -t option, -v gives, in addition to the name, information about the tape entries. -w (-t, -x modes) Requests confirmation between individual read or write operations. When this command option is present, tar prints the action to be taken, followed by the name of the file, and then waits for the user's confirmation. If a word beginning with y is given, the action is performed. Any other input means ``no''. -x Retrieves (extracts) files from an archive file or device. DESCRIPTION tar saves and retrieves files within an archive, which is often stored on removable media such as magnetic tape or 3.5-inch disks. Archives come in two basic varieties. Archives that are not embedded inside of files are called archives. They can occupy all of the available storage space. Archives that are embedded within files inside of file systems are called archive files. They can occupy the remaining storage once the overhead for the file system has been subtracted from the disk or tape media. The terms archive and tar-formatted data are not specific with regard to a storage format. When placed inside a normal file, an archive acquires all the usual file attributes, such as a filename and permission settings. When archive files are created, the file attributes are those associated with Macintosh files if the archive file is copied to a Macintosh disk using the Finder, or UNIX file attributes if left to reside on an A/UX file system. Five possible modes of operation are selected through the leading command option. Of these, two perform read operations, and three perform a variety of write operations. 4 January 1992



tar(1) tar(1)
Use the -x option to read from a tar-formatted stream of data. The following command line uses tar to read from the 3.5-inch disk inside drive zero and retrieve all of its tar-formatted files. tar -xf /dev/rfloppy0 The -c option creates a stream of tar-formatted data containing a copy of all the files supplied as file arguments. To create an archival version of each of the files cover, body, and graph inside of the archive file named project.arc, use tar -cf project.arc cover body graph EXAMPLES cd fromdir; tar cf - . | (cd todir; tar xf -) will copy directories from one directory tree (fromdir) to another (todir). STATUS MESSAGES AND VALUES If tar reports that not enough memory is available to hold the link tables, then the archive will not reliably maintain information about which files are linked. LIMITATIONS There is no way to ask for the nth occurrence of a file inside a given archive. Tape errors are handled ungracefully. The -b option 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 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. Empty directories are skipped when creating a tar archive. Note that tar c0m is not the same as tar cm0. tar is unable to create archives containing device files. FILES /usr/bin/tar /dev/rmt/* /dev/mt/* /tmp/tar* January 1992 5



tar(1) tar(1)
SEE ALSO ar(1), cpio(1), dd(1), tp(1) dump.bsd(1M) in A/UX System Administrator's Reference tar(4) in A/UX Programmer's Reference 6 January 1992

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