Too many successive open/closes in a script results in failure
WinSCP Version 5.9 (Build 6786) (OS 6.1.7601 Service Pack 1 - Windows 7 Professional)
Unclear when problem started.
Scripting
I have a script that looks like this:
====================
option batch abort
option confirm off
open <sitename1>
lcd "<directory1>"
get *.* -preservetime -delete
close
open <sitename2>
lcd "<directory2>"
get *.* -preservetime -delete
close
...
open <sitename(n)>
lcd "<directory(n)>"
get *.* -preservetime -delete
close
exit
====================
There are variations of the get command but basically the script open, gets, and closes a lot of sessions. Only one session is open at a time.
The problem appears to be that after about 20 open/closes the script fails as follows:
====================
Looking up host "<hostname>" for SSH connection
Connecting to xxx.xxx.xxx.xxx port 22
We claim version: SSH-2.0-WinSCP_release_5.9
Network error: Software caused connection abort
====================
If I comment out the portion of the script that fails, the next portion fails. If I comment out everything before the portion that fails, the failed portion and the remainder of the script completes successfully:
====================
Script: close
Closing connection.
Sending special code: 12
Sent EOF message
====================
The only solution I have at this point is to break the script up into separate tasks.
Unclear when problem started.
Scripting
I have a script that looks like this:
====================
option batch abort
option confirm off
open <sitename1>
lcd "<directory1>"
get *.* -preservetime -delete
close
open <sitename2>
lcd "<directory2>"
get *.* -preservetime -delete
close
...
open <sitename(n)>
lcd "<directory(n)>"
get *.* -preservetime -delete
close
exit
====================
There are variations of the get command but basically the script open, gets, and closes a lot of sessions. Only one session is open at a time.
The problem appears to be that after about 20 open/closes the script fails as follows:
====================
Looking up host "<hostname>" for SSH connection
Connecting to xxx.xxx.xxx.xxx port 22
We claim version: SSH-2.0-WinSCP_release_5.9
Network error: Software caused connection abort
====================
If I comment out the portion of the script that fails, the next portion fails. If I comment out everything before the portion that fails, the failed portion and the remainder of the script completes successfully:
====================
Script: close
Closing connection.
Sending special code: 12
Sent EOF message
====================
The only solution I have at this point is to break the script up into separate tasks.