Exit codes
Exit Codes
Section titled “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
[report.zip] 10.00 MiB / 10.00 MiB done$ echo $?0Failure example
2025/06/24 09:09:11 ERROR Failed to open SFTP session error=dial tcp 10.0.0.24:22: i/o timeout$ echo $?1A simple shell snippet demonstrates how to branch on the exit status:
#!/bin/bashif [ $? -eq 0 ]; then echo "Transfer successful"else echo "Transfer failed"fi