Topic "WinSCP with commandline and script"

Author Message
timeout notworking??

Guest


I have a little script for using winscp.com as SFTP Client.

The important execute is:
"C:\Program Files\WinSCP3\winscp3.com" /console /script="C:\Program Files\WinSCP3\example.cmd" /log=winscp.log /timeout=30

And now a little example from our logfile:
Quote:
. 2009-07-08 12:30:01.040 Using SSH protocol version 2
. 2009-07-08 12:30:01.072 Doing Diffie-Hellman group exchange
. 2009-07-08 12:30:01.150 Doing Diffie-Hellman key exchange with hash SHA-1
. 2009-07-08 12:30:01.244 Host key fingerprint is:
. 2009-07-08 12:30:01.244 ssh-rsa 1024 de:ee:7e:fe:30:2c:bd:95:1d:00:94:d4:90:ba:d5:94
. 2009-07-08 12:30:01.244 Initialised AES-128 SDCTR client->server encryption
. 2009-07-08 12:30:01.244 Initialised HMAC-SHA1 client->server MAC algorithm
. 2009-07-08 12:30:01.244 Initialised AES-128 SDCTR server->client encryption
. 2009-07-08 12:30:01.244 Initialised HMAC-SHA1 server->client MAC algorithm
! 2009-07-08 12:30:01.322 Using username "XXXXX".
. 2009-07-08 12:30:26.337 Waiting for data timed out, asking user what to do.
. 2009-07-08 12:30:26.337 Asking user:
. 2009-07-08 12:30:26.337 Der entfernte Rechner hat seit 25 Sekunden nicht geantwortet.

. 2009-07-08 12:30:26.337
. 2009-07-08 12:30:26.337 Weitere 25 Sekunden warten? ()
. 2009-07-08 12:30:26.337 Attempt to close connection due to fatal exception:
* 2009-07-08 12:30:26.337 Abgebrochen durch Benutzer.
. 2009-07-08 12:30:26.337 Closing connection.

You can see, the other side has not give a reply in 25 seconds.
BUT, i used the timeout time with 30 seconds ..
WHY closed the connection (winscp) after 25 seconds ??!!??
Any ideas??

I am using the v4.1.9 release.
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
From your command-line I suppose that you open session from the script using open command (what is right). In that case you have to add -timeout switch directory to open command. /timeout switch on commandline applies only if you open session from command line parameter (what would be wrong for scripting).
_________________
Martin Prikryl
ZOC

Guest


Sorry ... but i dont understand this.
How is see, i can ONLY set the timeout in the commandline.
I think, i cant set a timeout command in the script (where i have "option batch on" and my "open xxxxxxx" and so on).
I looked in the docu and cant find the timeout for that.

Please, maybe you can write me more to do that.

My command line call, you can this this in my first post.
My script look like this:
Quote:
#
# Automatically answer all prompts negatively not to stall
# the script on errors
option batch on

# Disable overwrite confirmations that conflict with the previous
option confirm off

# Connect
open XXXXXXXXXX

# Force binary mode transfer
option transfer binary


cd /EARN/outbox/
get *.* C:\Inetpub\ftproot\Eingang\
rm *.*

cd /EARN/inbox/
put C:\Inetpub\ftproot\Ausgang\*.* ./

# Disconnect
close
# Exit WinSCP
exit


Whats to do ??!!?
many thanks ...
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
ZOC wrote:
How is see, i can ONLY set the timeout in the commandline.

You can set timeout as switch to open command.
_________________
Martin Prikryl
ZOC

Guest


Ah, OK - thanks. I havent seen this ... Rolling Eyes
Thank you, i will try it ...

best regards from germany.
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