Synopsis
fcopysvr /s:SourceName [/su:SourceUserName] /d:DestName [/du:DestUserName] [/lg:LoginGroup] [/a | /b] [/rc:nn /ri:nnnn]
Description
The fcopysvr command transfers files between servers. The files that can be transferred using this command are the local files (including directories on the NFS server) or files on the FTP server.
Parameters
/s:SourceName
Specify a path name of the transfer source file, including the file name. You can use a wildcard for the file name.
Since wildcard characters such as an asterisk (*) have special meaning to shell, you need to enclose SourceName with either single or double quotation marks as necessary.
Use one of the following methods to specify SourceName in the URL format. The part of path name must be no longer than 255 characters. If the path name contains a space character, enclose it in double quotation marks.
Specify an absolute path from the root directory.
Specify the path name of desired file directly after "file://" string.
If the file path is "/usr/database/database.db":
file:///usr/database/database.db
Specify a path name to the FTP server.
The path name can be specified with a full path name or a relative path name from the current directory in logging in with FTP. Specify the path name in the format of "server name/path name of desired file" directly after "ftp://" string.
ftp://foo.bar.com//usr/database/database.db
ftp://foo.bar.com/database/database.db
/su:SourceUserName
Specifies a name of the user to be used to access the file specified in SourceName, and the user name to be specified must be set in the password management book in advance. SourceUserName must be no longer than 20 alphanumeric characters. If SourceUserName contains a space character, enclose it in double quotation marks.
If SourceName is specified using a local path, this parameter's specification is ignored. However, if SourceName is specified using a path on the FTP server, be sure to specify this parameter.
/d:DestName
Specify a path name of the destination file, including the file name. You can use a wildcard for the file name.
Since wildcard characters such as an asterisk (*) have special meaning to shell, you need to enclose DestName with either single or double quotation marks as necessary.
You can use the same specification methods as those described in the above "/s:SourceName" parameter. See the "/s:SourceName" parameter.
If the file name that already exists is specified, it will be overwritten. Note that the same file path name as the one (SourceName) specified with /s should not be specified.
/du:DestUserName
Specifies a user name to be used to access the file specified in DestName.
The user name specified in this parameter must be set in the password management book in advance. DestUserName must be no longer than 20 alphanumeric characters. If DestUserName contains a space character, enclose it in double quotation marks.
If DestName is specified using a local path, this parameter's specification is ignored. However, if DestName is specified using a path on the FTP server, be sure to specify this parameter.
/lg:LoginGroup
Specifies a login definition name used to manage the password management book. LoginGroup must be no longer than 256 characters, and enclose it in double quotation marks if a space character is contained.
If the /su or /du parameter is specified, be sure to specify this parameter.
/a
Transfers a file in the ASCII text mode.
This parameter is valid only when you transfer files on the FTP server.
/b
Transfers a file in the binary mode.
This parameter is valid only when you transfer files on the FTP server.
If neither /a nor /b is specified, the file is transferred in the binary mode.
/rc:nn
Specifies the retry count in case an error occurs in file transfer.
Specify an integer value between 0 and 99 for nn. Setting any other value results in an error. If omitted, no retry is performed.
If a wildcard is used to specify the transfer source file or transfer destination file, retry is performed only for the failed file.
/ri:nnnn
Specifies the retry interval in case an error occurs.
Specify an integer value between 0 and 9999 (in seconds) for nnnn. Setting any other value results in an error. The default value is 0.
This parameter is valid if 1 or a greater value is specified to nn in the /rc parameter.
Return Values
Return value | Meaning |
---|---|
0 | Completed |
Value other than 0 | Abended |
Command Location
Solaris | /opt/FJSVsnjss/bin |
HP-UX | /opt/FHPsnjss/bin |
AIX | /opt/FAIXsnjss/bin |
Linux | /opt/FJSVsnjss/bin |
Example
In the following example, the local file "/usr/database/master/database.db" on the server is transferred to the local file "/usr/database/database.db". If the transfer fails, retry is performed up to three times at an interval of 60 seconds.
fcopysvr /s:file:///usr/database/master/database.db /d:file:///usr/database/database.db /rc:3 /ri:60
Execution Results/Output Format
After the command has been through processing, the information at command completion is output to the standard output.
The contents to be output are shown below: [Process start time] MM-DD-YYYY HH:MM:SS [Server host/User name] Server host name/user name (*) [Retry count] Number of retries performed (*) [Error] Error message (*) [File transfer] Transfer source file name Transfer destination file name (**) [Retry count] Number of retries performed (**) [Error] Error message (**) [Process end time] MM-DD-YYYY HH:MM:SS
This information is output if the /su or /du parameter is specified.
If a wildcard is used, the information of each file is output by file basis.
In [Error], "None" is output if the command completed successfully. A message is output if the command is canceled or failed. For details on the messages, see the Systemwalker Operation Manager Message Guide.
If an error occurs before performing file transfer, a message is output in the following format:
[Process start time] MM-DD-YYYY HH:MM:SS [Command error] Error message [Process end time] MM-DD-YYYY HH:MM:SS
For details on the messages, see the Systemwalker Operation Manager Message Guide.
Cautions
Prior to running this command, you need to configure the password management book using the password management command. See "10.3.1 lgmanage Password Management Command" for further details.
When transferring files by specifying a path on the FTP server, it can be performed only when the path on the FTP server is specified for either the transfer source or the destination. The valid combinations of file path format at source and destination are listed below. Select one of the combinations from the list.
Specifying source file | Specifying destination file | |
---|---|---|
1 | Local path method | Local path method |
2 | Local path method | FTP server path method |
3 | FTP server path method | Local path method |
The FTP servers available for file transfer by specifying a path on it are limited to those on which the execution results of "dir" command are displayed in the following format (with permission, number of links, owner, group, size, date, time, and file name are listed in this order, in alphanumerical notation).
-rw-rw-r-- 1 xxxxx xxxxxx 605877 Dec 19 18:44 xxxxx.xxx -rw-rw-r-- 1 xxxxx xxxxxx 560661 Dec 19 18:59 xxxxx.xxx drwx------ 4 xxxxx xxxxx 96 Jan 20 1998 xxxxx -rw-rw-r-- 1 xxxxx xxxxx 6042 Jan 25 13:38 xxxxxxxxxxx -rw-rw-r-- 1 xxxxx xxxxx 5433 Feb 3 17:11 xxxxx.xxx -rw-rw-r-- 1 xxxxx xxxxx 2155 Feb 3 17:35 xxxxx.xxx -rw-rw-r-- 1 xxxxx xxxxx 3090 Feb 1 20:13 xxxxx.xxx
To verify whether or not file transfer can be performed by using a path on the FTP server, use the following method.
[Windows]
Execute the ftp command at a command prompt.
[UNIX]
Execute the ftp command on a server console or a telnet-connected console.
Follow the steps below for checking on UNIX.
$ ftp XXXXX <-ftp command(XXXXX:ftp server name) Connected to XXXXX. 220 XXXXX FTP server (UNIX(r) System V Release 4.0) ready. Name (XXXXX:YYYYY): YYYYY <-User name setting for the ftp server(YYYYY:user name) 331 Password required for YYYYY. Password: <-Password entry 230 User YYYYY logged in. ftp> dir <-dir command entry 200 PORT command successful. The dir result is output.
If this command is canceled, it is carried out at the point when one file has been completely transferred. Therefore, the command takes a longer time to quit if it is cancelled while a large file is being transferred.
When using a wildcard for the file name specified with the /s parameter, the following considerations are needed:
The number of files to be processed at a time should be 500 or less, including the files to be processed simultaneously by other Server Task Link commands.
The size per file should be 2GB or less.