Topic "Suppress errors (auto skip or retry)"

Author Message
flibble
[View user's profile]

Joined: 2011-08-26
Posts: 1
Location: Ireland
Firstly, sorry if this has been documented elsewhere. I couldn't find a solution after 30 minuted searching the docs.

I have a script that periodically downloads & deletes files from an FTP server. The problem is that if it comes across a file that it cannot delete (if that file is in use on the server for instance) then the script hands awaiting user input (abort | retry | skip etc). Is there any way to tell WinSCP to automatically skip or retry, or even abort, when this happens? Or will the script always fail until it gets user input?

Thanks
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24995
Location: Prague, Czechia
See "batch" option ("option batch" command):
https://winscp.net/eng/docs/scriptcommand_option
Redwing2

Guest


flibble wrote:
Firstly, sorry if this has been documented elsewhere. I couldn't find a solution after 30 minuted searching the docs.

I have a script that periodically downloads & deletes files from an FTP server. The problem is that if it comes across a file that it cannot delete (if that file is in use on the server for instance) then the script hands awaiting user input (abort | retry | skip etc). Is there any way to tell WinSCP to automatically skip or retry, or even abort, when this happens? Or will the script always fail until it gets user input?

Thanks


DID YOU GET AN ANSWER OR SOLUTION FOR THIS?
RightHandedMonkey

Guest


To avoid having errors stop your winscp script, try surrounding the operation you want to perform with the following:
option batch continue
synchronize both "C:\local_dir\" /remote_dir/
option batch off

This will set the script to ignore/skip when an error occurs. The final 'option batch off' is optional.
I know this is an older post but looking it up here helped me get a folder created when needed and the error ignored if the folder was already there:

option batch continue
mkdir /home/new_dir
option batch off

flibble wrote:
Firstly, sorry if this has been documented elsewhere. I couldn't find a solution after 30 minuted searching the docs.

I have a script that periodically downloads & deletes files from an FTP server. The problem is that if it comes across a file that it cannot delete (if that file is in use on the server for instance) then the script hands awaiting user input (abort | retry | skip etc). Is there any way to tell WinSCP to automatically skip or retry, or even abort, when this happens? Or will the script always fail until it gets user input?

Thanks
SsjCosty
[View user's profile]

Joined: 2015-03-17
Posts: 2
For me that doesn't work either.

It just gives a few errors and then the command tool just stops and exits winscp altogether.


This is my script:

Code:
cd /web-biz/vbiz.mcbtest.dk_backup_74904eaa-7d39-4421-823a-b59d07019753
option batch continue
option confirm off
rm *
exit
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24995
Location: Prague, Czechia
SsjCosty wrote:
For me that doesn't work either.

It just gives a few errors and then the command tool just stops and exits winscp altogether.

Duplicate post:
https://winscp.net/forum/viewtopic.php?t=15048
_________________
Martin Prikryl
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