PRIMECLUSTER Global File Services Configuration and Administration Guide 4.2 (Solaris(TM) Operating Environment) |
Contents Index |
Appendix B Reference Manual | > B.3 General Commands Specific to the GFS Local File System |
sfxcp [-fip] [ -e ext_action ] source_file target_file
sfxcp [-fip] [ -e ext_action ] source_file... target
sfxcp -r|-R [-fip] [ -e ext_action ] source_dir... target
The sfxcp command copies both files with extent attribute information and files without extent attribute information on the GFS Local File System. If necessary, the sfxcp command will operate on a file system other than the GFS Local File System, but in this case cp(1) should be used as much as possible.
In format 1 shown in SYNOPSIS, neither source_file nor target_file must be a directory file, and they must not be specified with the same name. The sfxcp utility copies the contents of the file indicated by source_file and the extent attribute information of the GFS Local File System to the destination path indicated by target_file. If target_file already exists, sfxcp overwrites the contents of the file. The mode (ACL if it is valid), owner, and group of the file, however, remain unchanged. For information about extent attribute information, see the explanation of the -e option. The latest update time in target_file and the latest access time in source_file are set as the copy time. If target_file file is not found, sfxcp creates a file named target_file. The mode of this file is the same as that of source_file. However, a sticky bit is not specified unless the user that issued this command is a super user. For the owner and group of target_file, the owner name and the group name of the owner are used. If target_file indicates a link to another file having a link, the other link remains and target_file assumed to be a new file.
In format 2, sfxcp copies one or more files indicated by source_file to a directory indicated by target. For each source_file, a new file is created in target in the same mode (the same ACL ACL if it is valid). In this case, this system uses the owner and group of the user that issues this command. When the type specified in source_file is directory, target is not found, and target is not directory, processing fails.
In format 3, sfxcp copies one or more directories indicated by source_dir to the directory indicated by target. Either -r or -R must be specified. sfxcp copies all files and sub-directories in each directory indicated by source_dir.
-e ext_option
Specifies an operation for extent attribute information. Explanation of ext_action.
AWEAppend Write Extent (default). When target and target_file already exist with extent attribute information, this option does not copy the extent attribute information. Otherwise, this option copies extent attribute information.
IWEInteractive Write Extent. When target and target_file already exist with extent attribute information, this option displays a confirmation message asking whether the extent attribute information should be overwritten. If the response is y, the extent attribute information is copied. If the response is another character, the information is not overwritten.
NWENot Write Extent. This option does not copy extent attribute information in the same way as cp(1).
OWEOverWrite Extent. This option forcibly copies the extent attribute information of source to target and target_file. Even though the source does not contain extent attribute information, it is forcibly copied to target and target_file.
-f
Releases a link. If a file descriptor is not obtained for the destination file, this option releases the link of the destination file and attempts to continue processing.
-i
Indicates interactive mode. When target and target_file specified, as destination files already exist, this option displays a confirmation message asking whether the data should be overwritten. If the response is y, copy processing is continued. If the response is another character, the data is not overwritten.
When both the -i option and -e IWE option are specified together, they are processed independently in interactive mode.
-p
Holds data. sfxcp copies the contents of the file indicated by source_file, and also specifies an owner and group ID, access right mode, update time, access time of the output file. If ACL is valid, the input file value is set as the ACL value. This command does not fail when it is not possible to specify an update time, access time, or access right mode. When the owner and group ID cannot be specified, sfxcp does not fail, and clears S_ISUID and S_ISGID of the output file. If sfxcp outputs a diagnostic message to the standard error output and returns a termination status other than 0.
To store the owner, group ID, access right mode, update time, and access time, the user must have access permission to the appropriate file. In other words, the user must have the same owner ID as that of the target file.
-r
Recursive. sfxcp copies to target the entire directory (that is, all files in the directory), and also copies all subdirectories in the directory and all files in the subdirectories.
-R
The same as -r, except hat a named pipe file is copied, not read.
The following operands can be specified:
source_file
Path name of an ordinary file to be copied
source_dir
Path name of a directory to be copied
target_file
Path name of the file used as the output when one file is copied regardless of whether the file already exists.
target
Path name of a directory to which a copied file is to be written
Examples in which one file is copied
% sfxcp goodies goodies.old % ls goodies* goodies goodies.old
Examples in which one file group is copied to a directory
% sfxcp ~/src/* /dst
Examples in which a specific directory is copied first to a new directory, and then to an existing directory
% ls ~/bkup /usr/example/fred/bkup not found % sfxcp -r ~/src ~/bkup % ls -R ~/bkup x.c y.c z.sh % sfxcp -r ~/src ~/bkup % ls -R ~/bkup src x.c y.c z.sh src: x.c y.c z.sh
Example in which data is forcibly copied on the basis of source information when target has extent attribute information
% sfxcp -e OWE source target
For information about environment variables LC_COLLATE, LC_CTYPE, LC_MESSAGES, and NLSPATH, which affect the execution of sfxcp, see environ(5).
The following termination status information is returned:
0 All files have been copied successfully.
>0 An error has occurred.
sfxcpio(1), sfxmv(1), sfxsetext(1), sfxgetext(1)
cp(1), chmod(1), chown(1), setfacl(1), utime(2), attributes(5), environ(5), largefile(5).
The access right mode of source_file is stored when copy is executed.
Users can clearly specify the end of a command line option with two consecutive hyphens ( -- ). When this method is used and a file name beginning with a single hyphen ( - ) is specified as the filename argument, sfxcp recognizes that the character string indicates a file name. If both -- and - are written on the same line, sfxcp interprets the second hyphen as specifying a file name.
sfxcp can copy data between different file systems. If a file on the GFS Local File System is copied to another file system (for example, UFS ), however, extent attribute information is deleted.
sfxcp will operate on a file system other than the GFS Local File System, but its operation will be equivalent to the conventional cp(1).
Contents Index |