PRIMECLUSTER Global File Services Configuration and Administration Guide 4.2 (Solaris(TM) Operating Environment) |
Contents Index |
Appendix F Reference Manual | > F.3 General Commands Specific to the GFS Shared File System |
sfccpio -i[bBcdfkmPrsStuvV] [ -C bufsize ] [ -E file ] [ -I file [ -M message ] ] [ -R userid ] [ pattern ... ]
sfccpio -o[aABcLPvV] [ -C bufsize ] [ -O file [ -M message ] ]
sfccpio -p[adlLmPuvV] [ -R userid ] directory
The sfccpio command copies both files containing file extension attribute information or files not containing file extension attribute information from the GFS Shared File System to the sfccpio archive and vice versa.
The sfccpio command also operates on a system other than the GFS Shared File System. In this case, using cpio(1) is strongly recommended. For information about the relationships between the sfccpio and cpio commands or the operations to be performed when the sfccpio archive is restored to a system other than the GFS Shared 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]
sfccpio -i (copy in) extracts a files extracts a file using the output previously created by sfccpio -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 sfccpio -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 sfccpio -o. If a file to be created by sfccpio -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]
sfccpio -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 file extension 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]
sfccpio -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, sfccpio 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 the sfccpio command 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 the sfccpio command can continue processing during replacement of a tape. (The sfccpio command terminates processing when the RETURN key is pressed.)
The following options can be specified:
-i
(copy in) sfccpio -i extracts a specified file from the standard input.
-o
(copy out) sfccpio -o reads a path name list from the standard input and copies the file to the standard output.
-p
(pass) sfccpio -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 any order.
-a
After copying a file, this option resets the input file access time. If sfccpio -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 sfccpio archive contains another sfccpio archive and an error occurs, the sfccpio command terminates. The sfccpio command 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 sfccpio 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 sfccpio -p.)
-R userid
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
Special verbose. Print a dot for each file read or written. Useful to assure the user that sfccpio is working without printing out all file names.
The following operands can be specified.
directory
Path name of an existing directory to be processed by sfccpio -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.
A file of two gigabytes or more cannot be stored. Also, an archive of eight gigabytes or more cannot be created.
The following are three sfccpio examples:
When the standard input is transferred to sfccpio -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 sfccpio -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 | sfccpio -oc > ../newfile
sfccpio -i extracts a file that matches a specified pattern (memo/a1, memo/b*), using the output of sfccpio -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 | sfccpio -icd "memo/a1" "memo/b*"
sfccpio -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 sfccpio, 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 | sfccpio -pdlmv newdir
When sfccpio is used together with find and -L option is specified in the sfccpio option, use -follow in the find option and vice versa. If -follow is not used, an unexpected result is displayed.
Note that for multi-tape archives, unload the old tape, load the new one, and continue to the next tape by typing the name of the next device (probably the same as the first tape). To stop, type a RETURN and sfccpio will end.
For information about environment variables LC_COLLATE, LC_CTYPE, LC_MESSAGES, LC_TIME, TZ, and NLSPATH, see environ(5).
The following termination status information is returned:
0 Terminated normally.
>0 An error occurred.
sfccp(1), sfcgetext(1), sfcgetfattr(1), sfcmv(1), sfcsetext(1), sfcsettime(1), sfcsetvolume(1).
ar(1), cat(1), cpio(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) in the "Solaris X Reference Manual Collection."
Contents Index |