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

Author Message
StijnNeirinck
[View user's profile]

Joined: 2014-01-15
Posts: 1
Location: Belgium
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]
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
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
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