Skip to content

Exit codes

connect follows the standard convention: 0 for success, non-zero for failure. You can rely on this behaviour when wiring the CLI into scripts or schedulers.

Successful run

Terminal window
$ connect move report.zip sftp://monitor01:password@10.0.0.24/incoming/
[report.zip] 10.00 MiB / 10.00 MiB done
$ echo $?
0

Failure example

Terminal window
$ connect move --batch report.zip sftp://monitor01:password@10.0.0.24/incoming/
2025/06/24 09:09:11 ERROR Failed to open SFTP session error=dial tcp 10.0.0.24:22: i/o timeout
$ echo $?
1

A simple shell snippet demonstrates how to branch on the exit status:

#!/bin/bash
connect move "$1" sftp://monitor01:password@10.0.0.24/incoming/
if [ $? -eq 0 ]; then
echo "Transfer successful"
else
echo "Transfer failed"
fi