remotecopy

Copy file or folder to or from one or more remote hosts using transport protocol

Syntax

remotecopy <flags> <protocol options>

Description

remotecopy <flags> <protocol options> copies a file or folder to or from one or more remote hosts by using a transport protocol (such as rsh or ssh). Copying from multiple hosts creates a separate file per host, appending the hostname to the specified filename.

The following table describes the supported flags and options. You can combined multiple flags in the same command, preceding each flag by a dash (-).

Flags and OptionsOperation
-local <file-or-foldername>Specify the name of the file or folder on the local host.
-remote <file-or-foldername>Specify the name of the file or folder on the remote host.
-fromSpecify to copy from the remote hosts to the local host. You must use either the -from flag, or the -to flag.
-toSpecify to copy to the remote hosts from the local host. You must use either the -from flag, or the -to flag.
-remotehost host1[,host2[,...]Specify the names of the hosts where you want to copy to or from. Separate the host names by commas without any white spaces. This is a mandatory argument.
-remoteplatform { unix | windows } Specify the platform of the remote hosts. This option is required only if different from the local platform.
-quietPrevent remotecopy from prompting for missing information. The command fails if all required information is not specified.
-helpPrint the help information for this command.
-protocol <type>

Force the usage of a particular protocol type. Specifying a protocol type with all its required parameters also avoids interactive prompting and allows for use in scripts.

The supported protocol types are scp, sftp and rcp.

To get more information about one particular protocol type, enter

remotecopy -protocol <type> -help

For example:

remotecopy -protocol sftp -help
<protocol options>Specify particular options for the protocol type being used.

Note

The file permissions on the copy might not be the same as the permissions on the original file.

Examples

Copy the local file mdce_def.sh to two other machines. (Enter this command on a single line.)

remotecopy -local mdce_def.sh -to
  -remote /matlab/toolbox/distcomp/bin -remotehost hostA,hostB

Retrieve folders of the same name from two hosts to the local machine. (Enter command on a single line.)

remotecopy -local C:\temp\log -from -remote C:\temp\mdce\log
  -remotehost winHost1,winHost2

See Also

Was this topic helpful?