SFTP
Connect to an SFTP server (with an optional host key check) and work on remote and local directories: list, create, rename, upload, download and remove files. Typical use: pick up or drop files on a partner server over SSH.
sftp connectsftp cdsftp lcdsftp pwdsftp lpwdsftp mkdirsftp lssftp renamesftp homesftp versionsftp putsftp getsftp rmsftp rm dirsftp disconnectsftp disconnect all

sftp connect <sessionId> <jsonObject>


Description

    Connect to an SFTP server. By default, the host key is not checked. To check it, add "strictHostKeyChecking": "yes" in the JSON of the connection (and optionally "knownHosts": the path of the known hosts file, by default ~/.ssh/known_hosts).

Parameters

    sessionId:   The session id - string - required
    jsonObject:   The JSON object information - string - required
admin
sftp connect "session1" {cm get "demo_cm_sftp";};
mentdb
1
Used in use cases (3 recipes)

    File transfer & remote systems engineer › Collect the bank statements over SFTP
    Integrator & ETL developer › Import a CSV from SFTP into a database, every morning
    File transfer & remote systems engineer › SFTP pickup with an atomic rename and a remote archive
Often used with

    cm get  ·  sftp disconnect  ·  sftp get  ·  date sysdate  ·  json parse_array  ·  log write  ·  sftp cd  ·  sftp home

sftp cd <sessionId> <directory>


Description

    Go to another remote directory.

Parameters

    sessionId:   The session id - string - required
    directory:   The remote directory - string - required
admin
sftp cd "session1" "/remote/dir";
mentdb
1
Used in use cases (2 recipes)

    File transfer & remote systems engineer › Collect the bank statements over SFTP
    File transfer & remote systems engineer › SFTP pickup with an atomic rename and a remote archive
Often used with

    cm get  ·  json parse_array  ·  sftp connect  ·  sftp disconnect  ·  sftp get  ·  sftp home  ·  sftp lcd  ·  sftp lpwd

sftp lcd <sessionId> <directory>


Description

    Go to another local directory.

Parameters

    sessionId:   The session id - string - required
    directory:   The local directory - string - required
admin
sftp lcd "session1" "/local/dir";
mentdb
1
Used in use cases (2 recipes)

    File transfer & remote systems engineer › Collect the bank statements over SFTP
    File transfer & remote systems engineer › SFTP pickup with an atomic rename and a remote archive
Often used with

    cm get  ·  json parse_array  ·  sftp cd  ·  sftp connect  ·  sftp disconnect  ·  sftp get  ·  sftp home  ·  sftp lpwd

sftp pwd <sessionId>


Description

    Get the current remote directory.

Parameters

    sessionId:   The session id - string - required
admin
sftp pwd "session1";
mentdb
/remote/dir
Used in use cases (1 recipe)

    File transfer & remote systems engineer › Collect the bank statements over SFTP
Often used with

    cm get  ·  execute  ·  file create  ·  file mkdir  ·  json parse_array  ·  sftp cd  ·  sftp connect  ·  sftp disconnect

sftp lpwd <sessionId>


Description

    Get the current local directory.

Parameters

    sessionId:   The session id - string - required
admin
sftp lpwd "session1";
mentdb
/local/dir
Used in use cases (2 recipes)

    File transfer & remote systems engineer › Collect the bank statements over SFTP
    File transfer & remote systems engineer › SFTP pickup with an atomic rename and a remote archive
Often used with

    cm get  ·  json parse_array  ·  sftp cd  ·  sftp connect  ·  sftp disconnect  ·  sftp get  ·  sftp home  ·  sftp lcd

sftp mkdir <sessionId> <directory>


Description

    Create a remote directory.

Parameters

    sessionId:   The session id - string - required
    directory:   The remote directory - string - required
admin
sftp mkdir "session1" "/remote/dir";
mentdb
1
Used in use cases (2 recipes)

    File transfer & remote systems engineer › Collect the bank statements over SFTP
    File transfer & remote systems engineer › SFTP pickup with an atomic rename and a remote archive
Often used with

    cm get  ·  json parse_array  ·  sftp cd  ·  sftp connect  ·  sftp disconnect  ·  sftp get  ·  sftp home  ·  sftp lcd

sftp ls <sessionId> <fileFilterPath>


Description

    Get all the files of the current remote directory.

Parameters

    sessionId:   The session id - string - required
    fileFilterPath:   The file filter path - string - required
admin
sftp ls "session1" "*"
mentdb
"[ { \"name\": \"filename.txt\", \"size\": \"255\", \"isDir\": \"0\" }, { \"name\": \"doc\", \"isDir\": \"1\" } ]"
Used in use cases (2 recipes)

    File transfer & remote systems engineer › Collect the bank statements over SFTP
    File transfer & remote systems engineer › SFTP pickup with an atomic rename and a remote archive
Often used with

    cm get  ·  json parse_array  ·  sftp cd  ·  sftp connect  ·  sftp disconnect  ·  sftp get  ·  sftp home  ·  sftp lcd

sftp rename <sessionId> <oldFile> <newFile>


Description

    Rename a remote file or directory.

Parameters

    sessionId:   The session id - string - required
    oldFile:   The old file path - string - required
    newFile:   The new file path - string - required
admin
sftp rename "session1" "file1" "file2";
mentdb
1
Used in use cases (2 recipes)

    File transfer & remote systems engineer › Collect the bank statements over SFTP
    File transfer & remote systems engineer › SFTP pickup with an atomic rename and a remote archive
Often used with

    cm get  ·  json parse_array  ·  sftp cd  ·  sftp connect  ·  sftp disconnect  ·  sftp get  ·  sftp home  ·  sftp lcd

sftp home <sessionId>


Description

    Get the home directory.

Parameters

    sessionId:   The session id - string - required
admin
sftp home "session1";
mentdb
/home/dir
Used in use cases (2 recipes)

    File transfer & remote systems engineer › Collect the bank statements over SFTP
    File transfer & remote systems engineer › SFTP pickup with an atomic rename and a remote archive
Often used with

    cm get  ·  json parse_array  ·  sftp cd  ·  sftp connect  ·  sftp disconnect  ·  sftp get  ·  sftp lcd  ·  sftp lpwd

sftp version <sessionId>


Description

    Get the protocol version of the server.

Parameters

    sessionId:   The session id - string - required
admin
sftp version "session1";
mentdb
3
Used in use cases (2 recipes)

    File transfer & remote systems engineer › Collect the bank statements over SFTP
    File transfer & remote systems engineer › SFTP pickup with an atomic rename and a remote archive
Often used with

    cm get  ·  json parse_array  ·  sftp cd  ·  sftp connect  ·  sftp disconnect  ·  sftp get  ·  sftp home  ·  sftp lcd

sftp put <sessionId> <localFile> <remoteFile> <mode>


Description

    Upload a file.

Parameters

    sessionId:   The session id - string - required
    localFile:   The local file path - string - required
    remoteFile:   The remote file path - string - required
    mode:   The mode (OVERWRITE | APPEND | RESUME) - string - required
admin
sftp put "session1" "file1" "file2" "RESUME";
mentdb
1
Used in use cases (1 recipe)

    File transfer & remote systems engineer › Collect the bank statements over SFTP
Often used with

    cm get  ·  execute  ·  file create  ·  file mkdir  ·  json parse_array  ·  sftp cd  ·  sftp connect  ·  sftp disconnect

sftp get <sessionId> <remoteFile> <localFile>


Description

    Download a file.

Parameters

    sessionId:   The session id - string - required
    remoteFile:   The remote file path - string - required
    localFile:   The local file path - string - required
admin
sftp get "session1" "remoteFile1" "localFile2";
mentdb
1
Used in use cases (3 recipes)

    File transfer & remote systems engineer › Collect the bank statements over SFTP
    Integrator & ETL developer › Import a CSV from SFTP into a database, every morning
    File transfer & remote systems engineer › SFTP pickup with an atomic rename and a remote archive
Often used with

    cm get  ·  sftp connect  ·  sftp disconnect  ·  date sysdate  ·  json parse_array  ·  log write  ·  sftp cd  ·  sftp home

sftp rm <sessionId> <remoteFile>


Description

    Remove a remote file.

Parameters

    sessionId:   The session id - string - required
    remoteFile:   The remote file path - string - required
admin
sftp rm "session1" "remoteFile1";
mentdb
1
Used in use cases (1 recipe)

    File transfer & remote systems engineer › Collect the bank statements over SFTP
Often used with

    cm get  ·  execute  ·  file create  ·  file mkdir  ·  json parse_array  ·  sftp cd  ·  sftp connect  ·  sftp disconnect

sftp rm dir <sessionId> <remoteDir>


Description

    Remove a remote directory.

Parameters

    sessionId:   The session id - string - required
    remoteDir:   The remote directory path - string - required
admin
sftp rm dir "session1" "remoteDir1";
mentdb
1
Used in use cases (1 recipe)

    File transfer & remote systems engineer › Collect the bank statements over SFTP
Often used with

    cm get  ·  execute  ·  file create  ·  file mkdir  ·  json parse_array  ·  sftp cd  ·  sftp connect  ·  sftp disconnect

sftp disconnect <sessionId>


Description

    Disconnect a session.

Parameters

    sessionId:   The session id - string - required
admin
sftp disconnect "session1";
mentdb
1
Used in use cases (3 recipes)

    File transfer & remote systems engineer › Collect the bank statements over SFTP
    Integrator & ETL developer › Import a CSV from SFTP into a database, every morning
    File transfer & remote systems engineer › SFTP pickup with an atomic rename and a remote archive
Often used with

    cm get  ·  sftp connect  ·  sftp get  ·  date sysdate  ·  json parse_array  ·  log write  ·  sftp cd  ·  sftp home

sftp disconnect all


Description

    Disconnect all sessions.

admin
sftp disconnect all;
mentdb
0