Announcement

Collapse
No announcement yet.

Preventing multi-sync script from exiting on failure

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Preventing multi-sync script from exiting on failure

    I have some scripts that have a structure of load <> , expand, sync, which repeats for a group of folder pairs.
    If the first of the group has an error (folder not available, for example), the entire script exits. I have the "create-empty" option, which fixes the problem if the local folder doesn't exist, but doesn't help if the remote folder is not present (and write permission is not present for the remote folder)

    How can I tell the sync operation to ignore errors (log them only) and continue the script?



    BCsyncfail-Capture.PNG
    Last edited by timg11; 18-Jan-2019, 10:07 AM.

  • #2
    Hello,

    Since script is sequential, and the next command could rely on the previous command to have worked, a fatal error will always end the current script run. What I would recommend is a single script (or multiple script) that use variables. This way, if any specific action fails, that entire script fails, but the next script can run.

    For example, bcscript.txt could be:
    load "%1" "%2"
    sync update:left->right

    and is called multiple times from a parent .bat file with:
    bcompare.exe "c:\bcscript.txt" "c:\source1" "c:\destination1"
    bcompare.exe "c:\bcscript.txt" "c:\source2" "c:\destination2"
    bcompare.exe "c:\bcscript.txt" "c:\source3" "c:\destination3"

    If any individual script fails, it fails. Then the next script call executes.
    Aaron P Scooter Software

    Comment

    Working...
    X