div class="article">When a file copy or transfer is performed, SSH Tectia Client will return a code indicating the result of the requested action(s). These codes indicate whether the requested action succeeded or not. They can be used when logging scripted transfers, so that the result of the transfer can be monitored and a specific action can be taken based on the exit code. The exit codes can be checked using the following commands:

Unix
$ echo $?

Windows
C:>echo %ERRORLEVEL%

Exit Codes for scp2 and sftp2

-1 Fatal error

Error message after a fatal error usually caused by wrong configuration syntax.

0 Operation was successful

1 Operation resulted in an undetermined error within sshfilecopy

There is an undetermined error. Check the command, and verify the user's access to the source and destination files and directories. Also ensure that the destination has sufficient disk space to receive the file.

2 Destination is not a directory

scp2 or sftp2 is expecting the destination to be a directory, but the destination given is a file or a non-valid directory.

3 Maximum symlink level exceeded

4 Connection to daemon failed

There is a connection problem between the client and the daemon. Resolve the connection issue before attempting the transfer again.

5 Connection was terminated for some reason

The connection with the daemon was lost.

6 File does not exist

The source file does not exist.

7 No permission to access file

The user performing the transfer does not have sufficient rights to access the source file or directory, or the destination file or directory.

8 Undetermined error from sshfilexfer

One possible reason for this error is that the destination host has run out of disk space while the transfer was in progress.

9 File transfer protocol mismatch

You are attempting to transfer from an ssh2 client to an ssh1 server, or you are attempting to transfer from an ssh1 client to an ssh2 server. The two protocols are incompatible, but some implementations support both protocols, or fallback and/or protocol emulation support may be available. Check the documentation for both the client and daemon for more information.