VanDyke Software



Using The SecureFX® SFXCL Move Command

Note: This tip is for use with SecureFX for Windows.

The SFXCL command-line utility that is included in SecureFX for Windows allows you to perform tasks from the command line. The utility recognizes general command-line instructions, as well as the additional QuickSync option that requires a specific syntax.

If you are using SecureFX 4.x for Windows and later, you can use the /Move flag in the SFXCL command-line utility to transfer and delete files in one step. The /Move option will transfer the specified files and then delete the successfully moved files from the source directory. You can also specify passwords on the command line.

Here is an example using of using the /Move option to transfer all .txt files from a remote server to a local server:

sfxcl /move sftp://user1@remoteserver/*.txt sftp://user@localserver/C:/

You can also specify the passwords for each server on the command line (the command below should appear on one line):

sfxcl /move sftp://user1:pass@remoteserver/*.txt sftp://user:pass@localserver/C:/

To move a file from one folder to another on the remote server, and to save the bandwidth related to downloading the file locally and then uploading the file, you can use the /Rename command. /Rename issues a rename command on the remote, similar to the UNIX 'mv' command.

In this example, the command will move the file from the "c:" root to the "temp:" root defined in VShell or other Secure Shell server:

sfxcl /rename sftp://user:pass@remoteserver/c:/test.txt temp:/test.txt

To move a file between folders in the same root, in this case to the "otherfolder" directory, you would use the command:

sfxcl /rename sftp://user:pass@remoteserver/c:/test.txt /otherfolder/test.txt

To rename the file, you would use the command:

sfxcl /rename sftp://user:pass@remoteserver/c:/test.txt /otherfolder/newfile.txt

You can find more information on using the SFXCL command-line utility in the SFXCL Command-Line Tool FAQ.and the SFXCL Automation Guide.

VanDyke Software uses cookies to give you the best online experience. Before continuing to use this site, please confirm that you agree to our use of cookies. Please see our Cookie Usage for details.