Script doesn't abort on fail when using 'option batch abort'

Advertisement

StijnNeirinck
Joined:
Posts:
1
Location:
Belgium

Script doesn't abort on fail when using 'option batch abort'

Script:
# Automatically abort script on errors
option batch abort
# Disable overwrite confirmations that conflict with the previous
option confirm off
# Connection
open ftp://Firma064:meZ15(J1)d@217.7.154.116 -passive=on
# Change remote directory
cd /Orders/test
# Upload the file to current working directory
put F:\EDI\VIEGA\OUT\ORDER\*.txt
# Disconnect
close
# Exit WinSCP
exit


Command:
winscp.com /script="F:\WINSCP\EDI\VIEGA\UPLOAD.TXT" /log="F:\WINSCP\EDI\VIEGA\upload.log"

Output:
batch abort
confirm off
Connecting to 217.7.154.116 ...
Connected with 217.7.154.116. Waiting for welcome message...
Connected
Starting the session...
Reading remote directory...
Session started.
Active session: [1] Firma064@217.7.154.116
/Orders/test
F:\...\8601827122.txt | 0 B | 0,0 KiB/s | binary | 0%
Lost connection.
Timeout detected.
Copying files to remote side failed.
(A)bort, (R)econnect (1 s):


WinSCP, Version 5.5.0 (Build 3839)


What am I doing wrong?[/u]

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,271
Location:
Prague, Czechia

Re: Script doesn't abort on fail when using 'option batch abort'

That's by purpose. This is error from which WinSCP can recover (reconnect and resume transfer), so it tries that.

You can disable this by setting option reconnecttime to short interval.
https://winscp.net/eng/docs/scriptcommand_option

Reply with quote

Advertisement

You can post new topics in this forum