Run SFTP Commands

FtpExec32x32

Description

Connects to a remote host with SFTP (SSH File Transfer Protocol), and runs a set of SFTP commands.

You can enter commands in the action Expression Editor, one command per line.

SFTP is a network protocol related to SSH and SCP. It is not the same as FTP (File Transfer Protocol) and FTPS (FTP Secure). For FTP commands, see Run FTP Commands.

Supported commands

The Run SFTP Commands action supports these commands:

Command Description Supported aliases Examples

cd

Change the directory on the remote host.

cwd

cd [remote_folder]

chgrp

Change the group of files on the remote host.

chgrp [group] [remote_file]

chmod

Change the permissions of files on the remote host.

chmod [mode] [file]

chown

Change the owner of files on the remote host.

chown [username] [file]

get

Retrieve a file from the remote host to the computer running the action.

recv, retr

get [remote_file]
get [remote_file] [local_file]

help

Get help on the use of SFTP commands.

rhelp

Display remote help options.

lcd

Change the directory on the computer running the action.

lcd [local_directory]

ls

List the contents of the current directory on the remote host.

list, mlsd, mlst, nlst, dir

ls [remote_directory]

lpwd

Show the present working directory on the computer running the action.

lpwd [local_directory]

lstat

Returns attributes about a remote file, but does not follow symbolic links.

lstat [remote_file]

mkdir

Create a directory on the remote host.

mkd

mkdir [remote_directory]

put

Copy a file from the computer running the action to the remote host.

send, stor

put [local_file]
put [local_file] [remote_file]

pwd

Show the present working directory on the remote host.

quit

Close the connection to the remote host.

close, exit, disconnect, bye

rename

Rename a file on the remote host.

rename [remote_actual_name] [remote_new_name]

rm

Delete a file on the remote host.

rm [remote_file]

rmdir

Remove a directory on the remote host, if the directory is already empty.

rmd

rmdir [remote_directory]

stat

Returns attributes about a remote file, following symbolic links.

status

stat [remote_file]

version

Show the SFTP version.

verbose

Turns verbose mode on or off.

Parameters

Name Mandatory Default Description

SFTP Trust Hosts

No

true

Accept all remote hosts. If set to false, you must provide a list of trusted hosts with the SFTP Known Hosts File parameter.

SFTP Hostname

Yes

SFTP hostname or IP address.

SFTP Port

No

22

SFTP host port.

SFTP User

Yes

SFTP user.

SFTP Password

This user’s encrypted password.

SFTP Unencrypted Password

This user’s password in plain text.

SFTP Timeout

No

Maximum amount of time that the SFTP session can remain idle or inactive before it is closed, in milliseconds.

SFTP Known Hosts File

No

File containing the list of trusted remote hosts.

SFTP Private Key File

No

Full path to the Java Key Store to use when connecting to the server.

SFTP Password Phrase

No

Encrypted Password Phrase.

SFTP Uncrypted Phrase

No

Password Phrase in plain text.

Proxy Protocol

No

Protocol used for the proxy server: HTTP, SOCKS, SOCKS4 or SOCKS5.

Proxy Host

No

Hostname for the proxy server.

Proxy Port

No

1080

Port of the proxy server.

Proxy User

No

Proxy server user.

Proxy Password

No

Proxy server user password, encrypted.

Proxy Unencrypted Password

No

Proxy server user password in plain text.

Passwords are encrypted using the encrypt <password> command on the Runtime engine command-line tool.

Published variables

Name

Description

Command

DELETED_FILES_SIZE

Size of the deleted file

Delete

LISTED_FILES_NUMBER

Number of files listed

List

LISTED_FILES_SIZE

Size of files listed

List

APPEND_ADDED_FILE_SIZE

Size of the added data

Append

RETRIEVED_FILES_SIZE

Size of the file received

Get

STORED_FILES_SIZE

Size of the file sent

Put