Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: option batch abort not behaving as expected

Abort of file transfer in case the remote file exists and overwrite is not allowed is not considered a failure. I can understand you do not like that. But it is designed so.
Ren

option batch abort not behaving as expected

I'm using WinSCP 3.8.2 standalone, and have the following script:

<script>
# abort on error
option batch abort
# switch to download directory
cd /download
# set transfer mode to ascii
option transfer ascii
# download the report files
get *.dat
# clear the download directory
rm *.dat
# disconnect
close
# exit WinSCP
exit
</script>

When a file exists in the target dir, the get command will issue an overwrite command and fail. However, the script continues with the next step, which clears the download directory. Given the 'option batch abort', I would not expect this, and do not want this. Your previous reply also indicates this should work.

How can I make the script really bail out when the get command fails?

Thanks.
martin

Re: Keep control of file transfer

Use "option batch abort" to abort the script in case "get" fails.
natha

Keep control of file transfer

Hi,
I am using WinSCP in MS SQL Server DTS package to download files from remote to local server on daily basis.

I am doing it this way in the script file:

[...]
# Download file(s) to the local directory d:\
get *.txt c:\BaseCDR\
# Delete downloaded file(s)
rm *.txt
[...]

Is there a way to control that the files have been properly downloaded before removing them from remote server?

Consider following:
1. I cannot use remote recycle bin.
2. It has no sense to count the downloaded files on local side, since the amount of files may vary.
3. Is there any way to retrieve number of files on remote server (compare local with remote)?

Thanx in advance for your reply.