Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: How to check the error code of the put command

shri wrote:

My question: Is it possible to query the return code of the put command and only if the put command was successful do some action? (I would appreciate a small sample if poss.)

Isn't this exactly what your current script does?
shri

How to check the error code of the put command

Hi all,

This is my first post here...

I have installed a client which is running very well. I have a new requirement though.

In my script I use put *.* to transfer multiple files. After the transmission is finished I move the files to a backup folder. At times the SFTP Server connection gets disrupted in the middle of the transmission (after transmitting let's say half of the files). As this leads to error code <> 0 of the complete script the files are not moved to backup folder which leads to some files being transmitted once again when the script runs next time.

My question: Is it possible to query the return code of the put command and only if the put command was successful do some action? (I would appreciate a small sample if poss.)

Thanks in advance for your support
SM