pxtar(1)
Name
pxtar − manipulates tape archives
Syntax
pxtar [−c | −r | −t | −u | −x] [−BdFhilmMpsvw] [− number] [b blocks] [−C directory ...] [−f file] [−L inputlist] [−N blocks] [−S blocksb | −S feet | −S feet @density ] [file ...]
Description
The pxtar command writes files to or retrieves files from an archive storage medium or an archive file. The pxtar command looks for archives on the default device (usually tape), unless you specify another device or archive file with the −f option.
Filenames must not be longer than 257 characters and must not contain spaces. Characters following the first space are ignored. Internally, the filename may be split into two pieces to fit into the header block. For more details, see Issue 3 of the X/Open Portability Guide, Volume 3, XSI Supplementary Definitions, section 18.5.
When writing to an archive, pxtar uses a temporary file (/tmp/tar*) and maintains in memory a table of files with several links. You will receive an error message if pxtar cannot create the temporary file, or if there is not enough memory available to hold the link tables.
Function Keys
You must supply one of the following five function keys to control the actions of pxtar:
−c Creates a new archive and writes the files at the beginning of the archive.
−r Writes the file at the end of the archive.
−t Lists the files in the order in which they appear in the archive. Files may appear more than once.
−u Adds file to the end of the archive only if it is not in the archive already or if it has been modified since it was written to the archive.
−x Extracts file from the archive. If you specify a directory, pxtar extracts all files in that directory from the archive. If you do not specify a file or a directory, pxtar extracts all of the files from the archive. When an archive contains multiple copies of the same file, pxtar extracts only the last one and overwrites all earlier ones. If you have superuser authority (see the su() reference page), pxtar creates all files and directories with the same user and group IDs as on the tape. If you do not have superuser authority, the files and directories have your user and group IDs.
Options
The options to pxtar are listed below. In all cases, a directory argument refers to all the files and subdirectories, recursively, within that directory. Options without corresponding arguments may appear separately or be grouped together. Options that take arguments may have them adjacent to the option letter or as the entire following argument. The −b, −C, −S, and −f options can accept optional spaces before their arguments.
−bblocks
Specifies the number of 512-byte blocks per record. The default is 20, which is appropriate for tape records. (The maximum is also 20.) Due to the size of inter-record gaps, tapes written with large blocking factors can hold much more data than tapes with only one block per record. The block size is determined automatically when tapes are read (function keys −x or −t). When archives are updated with the −u and −r functions, the existing record size is used. The pxtar command writes archives using the specified blocks value only when creating new archives with the −c flag. For output to ordinary files with the −f option, you can save disk space by using a blocking factor that matches the size of disk blocks (for example, −b4 for 2048-byte disk blocks). Ordinary files must be read using the same blocking factor used when they were created.
−B Forces input and output blocking to 20 blocks per record. This option was added so that pxtar can work across communications channels where the blocking may not be maintained.
−Cdirectory
Performs a chdir to a directory preceded by −C. This allows multiple directories not related by a close common parent to be archived using short relative pathnames. For example, to archive files from /usr/include and /etc, one might use the following command:
% pxtar c −C/usr/include −C/etc
−d Suppress separate entries for directories, blocks and character special files, and FIFOs (First In First Out piped processes). When this option is specified, pxtar writes only ordinary files to an archive, and extracts only ordinary files and the directories required to contain them as determined by the pathnames in the archive. Normally, pxtar preserves the directory permission codes and restores empty directories, special files, and FIFOs with the −x flag.
−ffile
Uses file as the archive to be read or written. When this option is not specified, pxtar uses a system-dependent default filename of the form /dev/rmt?h (usually /dev/rmt0h). If the file specified is − (minus), pxtar writes to standard output or reads from standard input. When writing to standard output, only the −c flag can be used (−r or −u cannot be used).
−F Checks the file type before archiving. SCCS, RCS, core, error files, filenames ending in .o and a.out files will not be archived.
−h Forces pxtar to follow symbolic links as if they were normal files or directories. Normally, pxtar does not follow symbolic links.
−i Ignores header checksum errors. The pxtar command writes a file header containing a checksum for each file in the archive. When this option is not specified, the system verifies the contents of the header blocks by recomputing the checksum, and aborts with a ‘directory checksum error’ when a mismatch occurs. When this option is specified, pxtar logs the error and then scans forward until it finds a valid header block. This permits restoring files from later volumes of a multi-volume archive without reading earlier volumes.
−l Writes error messages to standard output if pxtar cannot resolve all of the links to the files archived. When you do not specify this option, the system does not display these messages.
−Linputlist
Writes the files listed in the inputlist file to the archive. inputlist should contain one filename per line. Files and directories from inputlist are treated recursively. If you include the name of a directory in inputlist, pxtar command writes the directory to the archive as well as the files and subdirectories to the archive. If you also list files or directories on the command line, the contents of inputlist are included after pxtar has written all the files or the directories and their subdirectories to the archive.
−m Uses the time of extraction as the modification time. The default is to preserve the modification time of the files.
−M Instructs pxtar not to cross mount points. The default is to cross mount points.
−Nblocks
Allows pxtar to use very large clusters of blocks when it deals with streaming tape archives. Note, however, that on input, pxtar cannot automatically determine the block size of tapes with very long block sizes created with this option. In the absence of a −Nblocks argument, the largest block size that pxtar can automatically determine is 20 blocks.
−p Restores files to their original modes, ignoring the present umask. "Set user ID" and sticky information will also be restored when extracted by the superuser.
−s Tries to create a symbolic link if pxtar fails in its attempt to link (regular link) two files.
−S blocksb
−S feet
−S feet @density
Specifies the number of 512-byte blocks per volume (first format), independent of the tape blocking factor. You can also specify the size of the tape in feet by using the second form, and pxtar assumes a default density. The third form allows you to specify both tape length and density. Feet are assumed to be 11 inches long to be conservative. This option lets you deal more easily with multi-volume tape archives, where pxtar must be able to determine how many blocks fit on each volume. Note that tape drives vary in density capabilities. The density argument calculates the amount of data a system can fit on a tape. This allows the correct amount of data to be written to a tape.
−v Lists the name of each file as it is processed. With the −t flag, −v gives more information about the tape entries, including file sizes, times of last modification, UID, and GID, and permissions.
−w Displays the action to be taken followed by the filename, then waits for user confirmation. If the response begins with y or Y, the action is performed; otherwise, the file is ignored.
−number
Uses /dev/rmtnumberh instead of the default. For example, −2 is the same as −f/dev/rmt2h. The default unit is /dev/rmt0h.
Restrictions
There is no way to ask for any occurrence of a file other than the last.
There is no recovery from tape errors.
Although anyone can archive special files, only a user with superuser authority can extract them from an archive.
Do not replace /bin/tar with pxtar. Although the /bin/tar and pxtar commands have much in common, they are not interchangeable. The pxtar command provides compatibility and interoperability with XPG3 systems; pxtar is not intended as a replacement for /bin/tar. The /bin/tar command adds tape-label information to a tape archive, so /bin/tar and pxtar have different formats for multiple-volume archives. The /bin/tar command has several added switches that enable features used in the installation process and by setld. Substituting the pxtar for the /bin/tar causes the setld command to fail; other commands may also be affected.
Examples
1.To write file1 and file2 to a new archive on the default tape drive:
% pxtar −c file1 file2
2.To extract all files that are in the /tmp directory from the archive file on the tape device /dev/rmt2 and use the time of extraction as the modification time:
% pxtar −xm −f/dev/rmt2 /tmp
3.To create a new archive file that contains file1 and pass the archive file to the dd command to be written to the device /dev/rmt1:
% pxtar −cvf − file1 | dd of=/dev/rmt1
4.To display the names of the files in the disk archive file out.tar on the current directory:
% pxtar −vtf out.tar
5.To expand the compressed archive file fil.tar.z, pass the file to the pxtar command, and extract all files from the expanded archive file:
% pcat fil.tar.z | pxtar −xvf −
Compatibility Notes
Multi-volume archives created by pxtar are not interchangeable with multi-volume archives created by tar; single-volume archives are interchangeable.
The pxtar utility produces archives that follow the format requirements specified in the IEEE 1003.1-1988 (POSIX) standard and the X/Open Portability Guide, Issue 3.
Diagnostics
directory checksum error
The −i option was not specified, and a checksum error occurred.
Files
/usr/bin/pxtar Command path.
/dev/rmt0 Default archive name.
/tmp/tar* Temporary archive file.