Skip to content

Operation

Riversoft® STCP Gemini Rename is a command-line utility. It is not a service: each run processes the files and exits. The examples use the database mode (-db) and the default configuration file. All options are in Command reference.

Process one file

Give the routing and the file. With -src, also give the source, which is compared with the rules’ SrcRegEx:

stcpren -db -rules INBOUND -src PARTNER /mailbox/IN/NOTES.TXT

Scan a directory

Processes all files in the directory that pass the filters:

stcpren -db -rules INBOUND -scan /mailbox/IN
  • Without -scan, no directory is scanned. With -scan "", the ScanDir directory from the routing is used.
  • To include subdirectories, use -subdir2. To filter, use -fileregex and -dirregex.
  • A file with an error is recorded in the log and does not stop the scan of the others.

Automatic runs

TriggerHow to configure
Riversoft STCP Gemini ServerAssociate the routing with the instance events in the Riversoft Console Portal, such as file reception.
Riversoft STCP DirectLinkUse the routing external command (routeExternalCmd and routeExternalCmdParams). See Routing and distribution.
ScheduleRun the scan at intervals, with an instance schedule in the Riversoft Console Portal or with the operating system scheduler.

For scans scheduled at short intervals, use a semaphore so that a scan does not start before the previous one ends:

stcpren -db -rules INBOUND -scan /mailbox/IN -scansemname INBOUND -scansemoptions 1

With -scansemoptions 1, the new run exits immediately if the previous one is still running.

Test a routing

With -test, Riversoft STCP Gemini Rename shows the rule that would be applied to each file (message MSG7034), without processing it:

stcpren -db -rules INBOUND -test /mailbox/IN/NOTES.TXT
stcpren -db -rules INBOUND -scan /mailbox/IN -test

If no rule matches, message MSG7003 is recorded.

Export a routing

Writes a routing registered in the database to JSON, for review, backup or use in the local file mode:

stcpren -db -rules INBOUND -export /tmp

The file is written as /tmp/INBOUND.json. To choose the name, give the full file path in -export.

Use a routing in a local file

Without -db, give in -rules the path to the routing JSON file:

stcpren -rules /usr/local/stcpren/configs/inbound.json /mailbox/IN/NOTES.TXT

Exit codes

CodeMeaning
0Run completed.
1Failure processing the file, in the configuration or in the routing.
2Invalid command usage.
4Startup failure (license, database or log).

Use the exit code in scripts to decide the next steps. The details of each failure are in the log. See Monitoring and audit.

Check the version

stcpren -v