PRIMECLUSTER Global File Services Configuration and Administration Guide 4.2 (Solaris(TM) Operating Environment)
Contents Index PreviousNext

Appendix B Reference Manual> B.3 General Commands Specific to the GFS Local File System

B.3.2 sfxcpio(1) - Extracts or restores files from an archive with extent attribute information

[SYNOPSIS]

sfxcpio -i [ bBcdfkmPrsStuvV6 ] [ -C bufsize ] [ -E file ] [ -I file [ -M message ] ] [ -R id ] [ pattern ... ]
sfxcpio -o [ aABcLPvV ] [ -C bufsize ] [ -O file [ -M message ] ]
sfxcpio -p [ adlLmPuvV ] [ -R id ] directory

[DESCRIPTION]

The sfxcpio command copies both files containing extent attribute information and files not containing extent attribute information from the GFS Local File System to the sfxcpio archive and vice versa.

The sfxcpio command also operates on a system other than the GFS Local File System. In this case, using cpio(1) is strongly recommended. For information about the relationships between the sfxcpio and cpio(1) or the operations to be performed when the sfxcpio archive is restored to a system other than the GFS Local File System, see NOTES below.

The -i, -o, and -p options are used to select the processing to be executed. The type of processing for each option is explained in detail. (These types of processing are mutually exclusive.)

[Restore mode]

sfxcpio -i (copy in) extracts a files extracts a file using the output previously created by sfxcpio -o as the standard input. Only files having the name specified in pattern are selected. For information about pattern, see OPERANDS and sh(1) below. The extracted file is created as defined by the conditions, and copied to the current directory on the basis of the options described below. The file access right is the same as that of the previous output of sfxcpio -o.
The owner and group are the same as the owner and group of the current user unless the current user is super-user. If the current user is a super-user, the owner and group are the same as the owner and group obtained from the output file previously processed with sfxcpio -o. If a file to be created by sfxcpio -i already exists and the version of the file is the same or a newer version, a message is displayed and the file is not replaced. (The -u option is used to replace an existing file regardless of the conditions.)

[Storage mode]

sfxcpio -o (copy out) reads a path name list from the standard input and copies their files to the standard output together with path names, status information, and extent attribute information. When data is output, the output data is blocked on 512-byte boundaries by default. If the -B or -C option is used, output data can be blocked using the user-specified block size or with the block size, depending on a device.

[Pass Mode]

sfxcpio -p (pass) reads a path name list for file from the standard input, and creates a file according to the conditions, and copies it to a destination directory on the basis of the options below.
When data is output to a character-type device (-o) or input from a character-type device (-i), if the end of the medium (for example, end of a tape) is reached without the -O and -I option, sfxcpio displays the following message:
To continue, type device/file name when ready.
To continue the processing, replace the medium, enter a character-type special device name (for example, /dev/rmt/0m), and press RETURN key. This function is used to instruct sfxcpio to use different devices and to continue the processing. For example, when there are two tape units, this function is convenient for switching the current device to another device so that sfxcpio can continue processing during replacement of a tape (sfxcpio terminates processing when the RETURN key is pressed.)

[OPTIONS]

This system supports the following options:

-i

(copy in) sfxcpio -i extracts a specified file from the standard input.

-o

(copy out) sfxcpio -o reads a path name list from the standard input and copies the file to the standard output.

-p

(pass) sfxcpio -p reads a path name list for a specified file from the standard input.

After the -o, -i, or -p option is specified, the following options can be specified in an any order.

-a

After copying a file, this option resets the input file access time. If sfxcpio -pla (cannot be specified together with -m) is specified, the access time of a linked file is not reset.

-A

Adds a file to an archive. This option must be paired with the -O option. This option is valid only for files, floppy disks, or hard disk partition archives.

-b

Reverses the byte order of each word (can only be used together with the -i option.)

-B

Block data as 5120 bytes for data input/output. When the -B and the -C options are not used, the default buffer size is 512 bytes. The -B option is not used for the -p option. This is because the -B option is valid for input from or output to a /dev/rmt/0m a character-type special device.

-c

Reads and writes header information in ASCII mode, taking into account portability. There are no restrictions on user ID or group ID for this header format. The -c option means using extension device numbers supported only in the SVR4-based systems.

-C bufsize

Block input/output is in bufsize units. bufsize is replaced with a positive integer. When the -B and the -C options are not used, the default buffer size is 512 bytes. (The -C option is not used for the -p option; This is because the -C option is valid only for input to or output from a character-type special device such as /dev/rmt/0m.)

-d

Create a directory as required.

-E file

Specifies an (one filename per line) input file (file), including a file name list to be extracted from archive.

-f

Extracts all files excluding those specified in pattern. (For information about pattern, See OPERANDS below.)

-I file

Read the contents as an input archive. If the file is a character-type special device and it finishes reading all of the current medium, replace the medium and press the RETURN key to continue processing. This option can be used only with the -i option.

-k

Skips a damaged file header or input-output error. To copy a file from a damaged medium or media that are out of sequence, this option allows only files having a normal header to be read. (When an sfxcpio archive contains another sfxcpio archive and an error occurs, sfxcpio terminates. sfxcpio searches for the next normal header. When a smaller archive is found, this command reads data until it encounters its trailer and then terminates processing.) The -k option can be used only with the -i option.

-l

As much as possible, links files instead of copying them. (This option can be used only with the -p option.)

-L

Traces a symbolic link. The default does not trace a symbolic link.

-m

Fetches the previous file update time. This option is invalid if a directory is being copied. (This option cannot be used with the -a option.)

-M message

Defines a message for replacement of a medium. When a character-type special device is specified with the -O or -I option, this option defines a message that is displayed at the end of a medium. One %d can be can be used to display the sequence number of the next medium.

-O file

Changes an sfxcpio output destination to file. When file is a character-type special device and the current medium is full, replace the medium and press the RETURN key to continue processing. This option can be used only with the -o option.

-P

Holds ACL. When this option is used for output and ACL exists, ACL is written to the standard output together with other attributes. ACL is created as a special file having a special file type. When this option is used for input, ACL is restored from the standard input together with other attributes. This option can identify a special file type. This option cannot be used with the -c option because ACL is not necessarily supported on all systems. Also, portability is not assured. To take into account portability, use an ASCII header.

-r

Changes a file name in interactive mode. When only the RETURN key is pressed, the file is skipped. If "." is entered, the original path name is used. (This option is invalid for sfxcpio -p.)

-R id

Changes the owner and group information for each file to a user ID (id must be a valid login ID in the /etc/passwd file). Only a super user can use this option.

-s

Substitutes bytes for each half word.

-S

Substitutes a half word for each word.

-t

Displays the entered character strings. No file is then created. (This option cannot be used with -V option.)

-u

Executes copying regardless of the condition. (An old file is not ordinarily replaced with a new one.)

-v

Displays detail information and lists file names. When the -v option is used together with the -t option, data is output the same way as for the ls -l command (see ls(1)).

-V

Displays detail information: that is, completely displays the contents for each input or output file. This option is convenient when the user has confirmed that sfxcpio operates without displaying all file names.

[OPERANDS]

The following operands can be specified.

directory

Path name of an existing directory to be processed by sfxcpio -p.

pattern

Formula using a representation method for pattern matching. This formula is similar to the one (see sh(1)) the shell uses for file name pattern matching or regular representation. The following meta-characters are defined:
*
Matches all character strings, including an empty character string.
?
Matches any 1 character.
[...]
Matches one of the characters enclosed with braces. When two characters are delimited by a hyphen `-', they match all characters (including those two characters) between two characters according to the default collation sequence of the system. If the character following the first bracket `[' is a `!', the results is not assured.
!
Indicates a negation. For example, the !abc* is specified, the pattern matches a file name that does not begin with character string abc.
In patterns, meta-characters ?, *, and [...] match a slash (/) and a backslash (\) is an escape character. More than one pattern can be specified. If no character is specified in pattern, the default is * (that is, all files are selected).
Each pattern must be enclosed in double quotation marks ("). If it is not, a file in the current directory may be used.

[USAGE]

A file of two gigabytes or more cannot be stored. Also, an archive of eight gigabytes or more cannot be created.

[EXAMPLES]

The following are three sfxcpio examples:

When the standard input is transferred to sfxcpio -o, via a pipe, files are grouped and collected as one archive file (../newfile). The -c option ensures compatibility with a different machine from the machine with the archive file. To transfer a file name list to sfxcpio -o, via a pipe, find(1), echo(1), and cat(1), can be used instead of ls(1). If necessary, the output destination can be changed from a file to a device.

% ls | sfxcpio -oc > ../newfile

sfxcpio -i extracts a file that matches a specified pattern (memo/a1, memo/b*), using the output of sfxcpio -o (in the example below, transferred to a pipe using cat). This command also creates a directory under the current directory (-d option) as required, and stores the file in the appropriate directory. The -c option is available when an input file is created with a compatible header. If no pattern is specified, all files in newfile are stored in the directory.

% cat newfile | sfxcpio -icd "memo/a1" "memo/b*"

sfxcpio -p reads file names via a pipe and copies or links (-l option) those files to another directory (in the example below, newdir). The -d option means that a directory is created as required. The -m option fetches a modification time. To create a path name required to transfer data to sfxcpio, use the -depth option of find(1) command. With this function, the user can eliminate a problem that occurs when an attempt is made to create files under a read-only directory. The copy destination directory newdir is necessary.

% find . -depth -print | sfxcpio -pdlmv newdir

When sfxcpio is used together with find and -L option is specified in the sfxcpio option, use -follow in the find(1) option and vice versa. If -follow is not used, an unexpected result is displayed.

To perform archive processing for multiple tables, remove the old tape, mount a new one, and enter the next unit name (ordinarily, the same name as the first tape unit) to continue with the next tape. If the RETURN key is pressed, sfxcpio terminates.

[ENVIRONMENT]

For information about environment variables LC_COLLATE, LC_CTYPE, LC_MESSAGES, LC_TIME, TZ, and NLSPATH, see environ(5).

[TERMINATION STATUS]

The following termination status information is returned:

0 Terminated normally.

>0 An error occurred.

[SEE ALSO]

sfxcp(1), sfxmv(1), sfxgetext(1), sfxsetext(1)

cpio(1), ar(1), cat(1), echo(1), find(1), ls(1), setfacl(1), sh(1), tar(1), vold(1M), archives(4), attributes(5), environ(5), largefile(5), standards(5).

[NOTES]

The path name is limited to 256 bytes (default) in binary notation; otherwise, limited to 1,024 bytes.

If a file has too large a user ID or group ID for a selected header format, an error message is displayed. To create an archive that can support all the user ID or group ID values, use the -c option.

Only a super user can copy a special file.

One block is 512 bytes.

When the access right of a specific file is 000, the file contains character data; and the user is not root, the file is not stored.

While the volume management daemon is operating, in some cases a floppy disk unit cannot be accessed using a normal device name such as /dev/rdiskette. For details, see vold(1M).

To fetch and copy a file from a tape to hard disk, use the same blocking factor as that used to copy the file from hard disk to the tape. Therefore, specify the -B option.

sfxcpio can read only an archive in the sfxcpio format. An archive in the cpio format cannot be read.

sfxcpio will operate on a file system other than the GFS Local File System, but its operation will be equivalent to the conventional cpio(1).

sfxcpio can operate between different file systems. If a file on the GFS Local File System is copied to another file system (for example, UFS), extent attribute information is erased.


Contents Index PreviousNext

All Rights Reserved, Copyright(C) FUJITSU LIMITED 2004