I have been working on an automated script using the winscp.com utility to send out files to a selection of servers. I have run into a problem with one specific server that will time out and endlessly try to reconnect. At first I attempted to limit the amount of times the script would attempt to reconnect, when that failed I moved on to attempting to stop it from reconnecting at all.
My current (and admittedly hamfisted) script is the following.
batch abort
confirm off
reconnecttime off
open ftp://USER:PASSWORD@SERVER -passive=on -rawsettings SessionReopenAuto=0 SessionReopenBackground=0 SessionReopenTimeout=0 SessionReopenAutoStall=0 SessionReopenAutoIdle=0
lcd K:\FileLocation
put -transfer=automatic -nopreservetime -nopermissions FileName_*
exit
The logs from this script always end up looking like this:
put -transfer=automatic -nopreservetime -nopermissions FileName_*
FileName.xml | 0 KiB | 0.0 KiB/s | ascii | 0%
Lost connection.
Timeout detected.
Copying files to remote side failed.
Entering Passive Mode (140,147,249,7,40,18 )
(A)bort, (R)econnect (5 s): Reconnect
Connecting to SERVER ...
Connected with SERVER. Waiting for welcome message...
Connected
Starting the session...
Reading remote directory...
Session started.
Lost connection.
Timeout detected.
Copying files to remote side failed.
Entering Passive Mode (140,147,249,7,213,8 )
(A)bort, (R)econnect (5 s): Reconnect
Connecting to SERVER ...
Connected with SERVER. Waiting for welcome message...
Connected
Starting the session...
Reading remote directory...
Session started.
Lost connection.
(...)
I was wondering if anyone had an insight into either changing the default action of the reconnect answer to abort or the proper
reconnecttime
/
-rawsettings
to stop the reconnect attempts from continuing indefinitely.