Suppress errors (auto skip or retry)

Advertisement

flibble
Joined:
Posts:
1
Location:
Ireland

Suppress errors (auto skip or retry)

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

Reply with quote

Advertisement

RightHandedMonkey
Guest

Re: Suppress errors (auto skip or retry)

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

Reply with quote

SsjCosty
Joined:
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.
<invalid hyperlink removed by admin>

This is my script:
cd /web-biz/vbiz.mcbtest.dk_backup_74904eaa-7d39-4421-823a-b59d07019753
option batch continue
option confirm off
rm *
exit

Reply with quote

Advertisement

You can post new topics in this forum