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.TXTScan 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 "", theScanDirdirectory from the routing is used. - To include subdirectories, use
-subdir2. To filter, use-fileregexand-dirregex. - A file with an error is recorded in the log and does not stop the scan of the others.
Automatic runs
| Trigger | How to configure |
|---|---|
| Riversoft STCP Gemini Server | Associate the routing with the instance events in the Riversoft Console Portal, such as file reception. |
| Riversoft STCP DirectLink | Use the routing external command (routeExternalCmd and routeExternalCmdParams). See Routing and distribution. |
| Schedule | Run 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 1With -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 -testIf 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 /tmpThe 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.TXTExit codes
| Code | Meaning |
|---|---|
0 | Run completed. |
1 | Failure processing the file, in the configuration or in the routing. |
2 | Invalid command usage. |
4 | Startup 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