Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hi!

Here are the steps you can follow:

Step 1: Enable SFTP/FTP origin to produce events by checking Produce Events checkbox.

image description

Step 2: Add Stream Selector processor to handle finished-file events.

image description

Step 3: Add Shell executor and on Environment tab set the current file name and path in environment variable, for example, file_to_archive using expression ${record:value('/filepath')}.

image description

Step 4: On Script tab add shell script to archive the file. For example:

#!/bin/bash
FILE_TO_ARCHIVE=$file_to_archive
ARCHIVE_DIR="/path/to/archive/folder"
mv "$FILE_TO_ARCHIVE" $ARCHIVE_DIR
exit 0

Note that $file_to_archive in the script matches variable name set in Step 3.

image description

Hope this helps!

Cheers, Dash

Hi!

Here are the steps you can follow:

Step 1: Enable SFTP/FTP origin to produce events by checking Produce Events checkbox.

image description

Step 2: Add Stream Selector processor to handle finished-file events.events using condition expression ${record:eventType() == "finished-file"}

image description

Step 3: Add Shell executor and on Environment tab set the current file name and path in environment variable, for example, file_to_archive using expression ${record:value('/filepath')}.

image description

Step 4: On Script tab add shell script to archive the file. For example:

#!/bin/bash
FILE_TO_ARCHIVE=$file_to_archive
ARCHIVE_DIR="/path/to/archive/folder"
mv "$FILE_TO_ARCHIVE" $ARCHIVE_DIR
exit 0

Note that $file_to_archive in the script matches variable name set in Step 3.

image description

Hope this helps!

Cheers, Dash