How to check the error code of the put command

Advertisement

shri
Joined:
Posts:
1
Location:
Switzerland

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

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,454
Location:
Prague, Czechia

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?

Reply with quote

Advertisement

You can post new topics in this forum