Exit codes
Exit Codes
Section titled “Exit Codes”This tool supports standard exit codes to indicate the success or failure of an operation.
- On success (e.g., a file is uploaded successfully), the application will return an exit code of
0
.
$ connect send sftp -h 10.0.0.24 -l monitor01 -p password --file file1.zip2025/06/24 09:08:22 INFO Files to send: count=1[file1.zip] 10.00 MiB / 10.00 MiB done$ echo $?0
- On failure, the application will return a non-zero exit code, indicating that an error occurred.
$ connect send sftp -h 10.0.0.24 -l monitor01 -p password --file file1.zip --batch2025/06/24 09:08:41 INFO Files to send: count=12025/06/24 09:09:11 ERROR Error while getting sftp session error=dial tcp 10.0.0.24:22: i/o timeout file=file1.zip$ echo $?1
This behavior makes it easy to integrate the tool into custom scripts or automation workflows, where exit codes can be used to programmatically detect and handle errors.
Example usage in a shell script:
#!/bin/bashconnect send sftp -h 10.0.0.24 -l monitor01 -p password --file file1.zipif [ $? -eq 0 ]; then echo "Upload successful"else echo "Upload failed"fi