Client Documentation

Start Page 3. Configuration instructions 3.4. Advanced configuration

3.4. Advanced configuration

The current section describe advance configuration options.

3.4.1. Triger external command execution

3.4.1.1. preprocess

Optional:

Yes

Default value:

None

Values:
  • Path to an executable or script.
From version:

1.5.1

To version:

None

Description:

Command to run locally before starting a transfer.

If the preprocess command fails, the transfer is skipped until the preprocess command returns with exit code 0.

  • GET
    • For get transfer, if the command contains the string ‘%file%’, it will be replaced with the value contained by the ‘remotefile’.
    • The command will be called once per transfer, regardless whether the remote folder contains multiple files.
  • PUT
    • For put transfer, if the command contains the string ‘%file%’, it will be replaced with the file path of the local file which is going to be transferred.
    • If the inbox folder contains multiple files, it will be called separately for each file.
    • When calling ‘preprocess’ command for PUT transfers, the files are still located inside the inbox folder and contain no timestamp or other changes.

3.4.1.2. postprocess

Optional:

Yes

Default value:

None

Values:
  • Path to an executable or script.
From version:

1.5.1

To version:

None

Description:

Command to run locally at the end of the transfer.

This command is executed at the end of each transfer after ‘postprocesssuccess’ and ‘postprocessfail’.

It will get executed when the transfer fails, it succeeds or no files are transferred.

If the command contains the string ‘%file%’, it will be ignored.

It will not be called for command type transfers.

3.4.1.3. postprocesssuccess

Optional:

Yes

Default value:

None

Values:
  • Path to an executable or script.
From version:

1.5.1

To version:

None

Description:

Command to run locally after a file was successfully transferred.

It will not be called for command type transfers.

If the command contains the string ‘%file%’, it will be replaced with the full path of the local file which is transferred.

If the inbox contains multiple files, it will be called separately for each file.

  • PUT
    • When calling the command for PUT transfers, the files are located inside the outbox folder and contain the timestamp applied to the filename (if the timestamp option was enabled).
  • GET
    • When calling the command for GET transfers, the files are located inside the outbox folder and contain the timestamp applied to the filename (if the timestamp option was enabled).

3.4.1.4. postprocessfail

Optional:

Yes

Default value:

None

Values:
  • Path to an executable or script.
From version:

1.5.1

To version:

None

Description:

Command to run locally if a file transfer fails after retrying for a number of times defined by ‘maxtry’.

It will not be called for command type transfers.

If the command contains the string ‘%file%’, it will be replaced with the full path of the local file which was transferred.

  • PUT
    • When calling the command for PUT transfers, the files are located inside the outbox folder and contain the timestamp applied to the filename (if the timestamp option was enabled).
  • GET
    • When calling the command for GET transfers, the files are located inside the outbox folder and contain the timestamp applied to the filename (if the timestamp option was enabled).

3.4.1.5. runbeforetransfer & runaftertransfer

Optional:

Yes

Default value:

None

Values:
  • SFTP/FTP command to be executed on the server.
From version:

1.5.1

To version:

None

Description:

Run a SFTP or FTP command on the remote server before or after a file is transferred.

Multiple commands can be specified by separating them with ‘;’.

Since the runaftertransfer executes commands on the remote server, the set of accepted commands as well as command syntax is dictated by the remote server capabilities.

The runaftertransfer uses raw SFTP or FTP commands and the syntax varies between SFTP and FTP.

For example to rename or move a file on the remote server you will have to use the following runaftertransfer, according to the protocol used for the transfer:

  • for SFTP: runaftertransfer = ‘rename %file% final/%file%’
  • for FTP and FTPS: runaftertransfer = ‘RNFR %file% ; RNTO final/%file%’

Here is a list of common raw FTP commands accepted by most FTP servers: http://www.nsftools.com/tips/RawFTP.htm

SFTP commands are described at the following URL: http://tinyurl.com/SFTP-commands

SFTP commands support the * wildcard and wildcard expansion is done in case sensitive mode. Even when client or server is on a Windows machine.

If executing a command fails, the whole transfer will fail.

3.4.2. Archive transfered files and transfer activity log

SFTPPlus Client can be configured to store all transfered files or log for transfer activity into an archive folder.

This can be use to audit past activity or transfered files.

3.4.2.1. archive

Optional:

Yes

Default value:

‘y’

Values:
  • ‘n’
  • ‘y’
From version:

1.5.1

To version:

None

Description:

Archive successfully transferred files.

3.4.2.2. archiveprocessfiles

Optional:

Yes

Default value:

‘y’

Values:
  • ‘n’
  • ‘y’
From version:

1.5.1

To version:

None

Description:

Archive process files: .bat, .result, .sftp, initiate.

3.4.2.3. keeponfail

Optional:

Yes

Default value:

‘y’

Values:
  • ‘n’
  • ‘y’
From version:

1.5.1.rc20

To version:

None

Description:

Indicates whether a file should be moved into failed archive folder if the transfer fails.