Topic "How to check the error code of the put command"

Author Message
shri
[View user's profile]

Joined: 2010-04-20
Posts: 1
Location: Switzerland
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
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
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?
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License