Main Content

remotecopy

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

remotecopy has been removed. Use scp or sftp instead. For more information, see Version History.

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 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 and sftp.

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 mjs_def.sh to two other machines. (Enter this command on a single line.)

remotecopy -local mjs_def.sh -to
  -remote /matlab/toolbox/parallel/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\mjs\log
  -remotehost winHost1,winHost2

Version History

expand all

R2022b: remotecopy has been removed

remotecopy is no longer supported.

  • Previously you used remotecopy and -protocol scp to copy files to and from a remote host using the scp protocol.

    The following table details how to use scp instead.

    ErrorsRecommended
    remotecopy -remotehost host1 -local /my/file/path -to -remote /remote/file/path -protocol scp
    scp /my/file/path host1:/remote/file/path
    remotecopy -remotehost host1,host2 -local /my/file/path -to -remote /remote/file/path -protocol scp
    scp /my/file/path host1:/remote/file/path
    scp /my/file/path host2:/remote/file/path
    remotecopy -remotehost host1 -local /my/file/path -from -remote /remote/file/path -protocol scp
    scp host1:/remote/file/path /my/file/path
  • Previously you used remotecopy and -protocol sftp to copy files to and from a remote host using the sftp protocol.

    The following table describes how to use sftp instead.

    ErrorsRecommended
    remotecopy -remotehost host1 -local /my/file/path -to -remote /remote/file/path -protocol sftp
    sftp /my/file/path host1:/remote/file/path
    
    remotecopy -remotehost host1,host2 -local /my/file/path -to -remote /remote/file/path -protocol sftp
    sftp /my/file/path host1:/remote/file/path
    sftp /my/file/path host2:/remote/file/path
    remotecopy -remotehost host1 -local /my/file/path -from -remote /remote/file/path -protocol sftp
    sftp host1:/remote/file/path /my/file/path

See Also