cpio(1)

cpio(1)

Note that cpio archives created using a raw device ®le must be read using a raw device ®le.

When the end of the tape is reached, cpio prompts the user for a new special ®le and continues.

If you want to pass one or more metacharacters to cpio without the shell expanding them, be sure to precede each of them with a backslash (\).

Device ®les written with the -oxoption (such as /dev/tty03) do not transport to other implementations of HP-UX.

EXTERNAL INFLUENCES

Environment Variables

LC_COLLATE determines the collating sequence used in evaluating pattern matching notation for ®le name generation.

LC_CTYPE determines the interpretation of text as single and/or multi-byte characters, and the characters matched by character class expressions in pattern matching notation.

LC_TIME determines the format and content of date and time strings output when listing the contents of an archive with the v option.

LANG determines the language in which messages are displayed.

If LC_COLLATE, LC_CTYPE, or LC_TIME is not speci®ed in the environment or is set to the empty string, the value of LANG is used as a default for each unspeci®ed or empty variable. If LANG is not speci®ed or is set to the empty string, a default of "C" (see lang(5)) is used instead of LANG. If any internationalization variable contains an invalid setting, cpio behaves as if all internationalization variables are set to "C". See environ(5).

International Code Set Support

Single- and multi-byte character code sets are supported.

RETURN VALUE

cpio returns the following exit codes:

0Successful completion. Review standard error for ®les that could not be transferred.

1Error during resynchronization. Some ®les may not have been recovered.

2Out-of-phase error. A ®le header is corrupt or in the wrong format.

DIAGNOSTICS

Out of phase--get help

Perhaps the "c" option should[n't] be used

cpio -icould not read the header of an archived ®le. The header is corrupt or it was written in a different format. Without the R option, cpio returns an exit code of 2.

If no ®le name has been displayed yet, the problem may be the format. Try specifying a different header format option: null for standard format; c for ASCII; b, s, P, or S, for one of the byte- swapping formats; or 6 for UNIX Sixth Edition.

Otherwise, a header may be corrupt. Use the R option to have cpio attempt to resynchronize the ®le automatically. Resynchronizing means that cpio tries to ®nd the next good header in the archive ®le and continues processing from there. If cpio tries to resynchronize from being out of phase, it returns an exit code of 1.

Other diagnostic messages are self-explanatory.

EXAMPLES

Copy the contents of a directory into a tape archive:

ls cpio -o > /dev/rmt/c0t0d0BEST

Duplicate a directory hierarchy:

cd olddir

find . -depth -print cpio -pd newdir

The trivial case

 

 

HP-UX Release 11i: December 2000

− 3 −

Section 1119

c