The RCP (Remote Copy) command copies a file between your local host and a remote internet host. You can also use RCP to copy a file between two remote internet hosts. You specify the source and destination file names, each in the format appropriate for the source or destination system. For copying files from one remote host to another, the following rules apply: o If you do not have proxy login accounts (or authentication file entries) for both the source and remote hosts, you must have the same user name and password on both source and destination hosts. Use the /PASSWORD qualifier and, if necessary, the /USER_NAME qualifier, to specify the authentication information for the remote hosts. o If you have a proxy login account (or authentication file entry) on one of the remote hosts only, use the /PASSWORD qualifier and, if necessary, the /USER_NAME qualifier to specify the authentication information for the other host. To recursively copy every file and subdirectory in a directory, use the /RECURSIVE qualifier with the RCP command. To preserve file format and other attributes when copying files between two OpenVMS systems, use the /VMS qualifier (UNIX format: -v option). For more information, see File_Formats. You can also use the COPY/RCP command to copy files across the network. For more information on this command, enter HELP COPY/RCP at the DCL prompt. Note that you can also use FTP to transfer files.
1 – File Formats
RCP on OpenVMS is best used for transferring text files. By default, RCP converts any type of OpenVMS file that is not STREAM_LF, FIXED, or UNDEFINED to STREAM_LF format, using the standard OpenVMS CONVERT utility. RCP specifies the files in the following way: FILE;ORGA SEQU;RECO;CARR CARR;FORM STREAM_LF;SIZE 0;BLOCK YES Options available for changing the default behavior for file copy operations include the following: o Convert FIXED and UNDEFINED format files to STREAM_LF You can change the behavior of RCP to convert FIXED and UNDEFINED format files to STREAM_LF format by using the following logical name: TCPIP$RCP_SEND_FIX_FORMAT_AS_ASCII If this logical name is set to the value 1, RCP converts FIXED and UNDEFINED files to STREAM_LF format. If this logical name is set to a value other than 1, RCP will not convert those files that have a fixed-length record size that matches the value of the logical name; RCP will convert all other FIXED and UNDEFINED files. For example, if you set this logical name to 512, RCP will not convert FIXED or UNDEFINED files with a fixed-length record size of 512 (such as OpenVMS executable image files); RCP will convert all other FIXED and UNDEFINED files. o Preserve File Attributes in OpenVMS-to-OpenVMS File Transfer In an OpenVMS-to-OpenVMS transfer, the receiving peer creates the file as a STREAM_LF file by default. You can preserve the file type and other attributes of a file transferred between two OpenVMS systems by using the /VMS qualifier (UNIX format: use the -v option) with the RCP command. WARNING Specify this qualifier only for file copy operations between two OpenVMS systems; otherwise, the operation will fail.
2 – File Size
When transferring files, the RCP protocol requires that the length of the file be sent as part of the protocol. The length is interpreted as a signed 32-bit integer. Therefore, files transferred using RCP must be less than 4 GB minus 1 byte.
3 – Examples
The following examples show how to use RCP commands to copy files from one host to another host: 1. User BEST has the account best on the UNIX host haven. User BEST's password for that account is IMusici, which must be enclosed in quotation marks because it is mixed case. The following command copies the file /symph/nine on haven to the local directory on the OpenVMS system (the UNIX file specification also must be enclosed in quotation marks): $ RCP /PASSWORD="IMusici" "haven:/symph/nine" 2. User BEST has a proxy account on the remote UNIX host musicx. The following command copies the file /symph/pastoral from host musicx to the directory [SYMPH6] on the device DKA300: on BEST's local OpenVMS system: $ RCP "musicx:/symph/pastoral" ":DKA300:[SYMPH6]" 3. With the following command, user BEST copies each subtree rooted at the /symph directory to the directory [SYMPHS] on the device DKA300: on BEST's local OpenVMS system. $ RCP/RECURSIVE "haven:/symph" ":DKA300:[SYMPHS]" 4. With the following command, user BEST copies all files from the directory /symphonies on remote host musicx to the directory /symph on remote host haven: $ RCP /PASSWORD="IMusici" "musicx:/symphonies/*" "haven:/symph/*" 5. In the following example, user BEST uses the DCL command COPY/RCP to transfer the complete subdirectory tree /symph from remote UNIX host haven to remote OpenVMS host FRAM. Both hosts require a password. (When using the RCP command to transfer files between two remote hosts, you need a proxy account or an entry in the authentication file for at least one of the two remote hosts.) User BEST has an account under the same name on both hosts. $ COPY/RCP haven"BEST IMusici"::"/symph/*" To: FRAM"VAUGHN MYLES"::[classic.compositions]*"