Announcement

Collapse
No announcement yet.

Change filter in same script?

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • Change filter in same script?

    I'm trying to consolidate my separate sync scripts into a single script and was wondering if I can change filter settings farther down in script or if they are all additive?

    Example:
    I want to sync an entire drive with the exception of a couple of folders to one destination so I filter out the folder names. But then later in script I want to then sync just those folders to a different destination so don't want the filter ignoring them. Is there a way to do this?

    filter include-protected
    filter "-$RECYCLE.BIN\;-#recycle\;-System Volume Information\;-SomeFolder"

    load "F:" "W:"
    sync create-empty mirror:left->right

    filter "-$RECYCLE.BIN\;-#recycle\;-System Volume Information" #Can I just do this to override the previous filter

    load "F:\SomeFolder" "X:\SomeFolder"
    sync create-empty mirror:left->right
    ​​

  • #2
    Apparently this does work unless because the load is specifically specifying the folder the filter does not come into play.

    Comment


    • #3
      Hello,

      Yes, the script is sequential, so you can think of it as loading a blank folder compare, putting a filter string into the toolbar, loading folders into the base folder bars, and then putting a new filter into the filter bar and put another pair of folders into the folder compare.

      The thing to be aware of would be any fatal error, such as failing to load a base folder, will stop the script and it won't continue.

      If you want to use a single script, but still have multiple calls (so one could fail, but the automation could go to the next task, using variables. Something like

      bcompare.exe @c:\script.txt "c:\folder1" "c:\folder2" "-$RECYCLE.BIN\;-#recycle\;-System Volume Information\;-SomeFolder"
      bcompare.exe @c:\script.txt "c:\folder3" "c:\folder4" "-$RECYCLE.BIN\;-#recycle\;-System Volume Information"

      where the one script.txt can reference the text parameters into the script with variables

      filter include-protected
      filter "%3"
      load "%1" "%2"
      sync create-empty mirror:left->right
      Aaron P Scooter Software

      Comment

      Working...
      X
      😀
      🥰
      🤢
      😎
      😡
      👍
      👎