Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2011
    Posts
    4

    Question Wildcard includes

    So I am trying to synchronize some files selected with wildcard includes. Files on the left are:

    \\rds2\c$\Users\*\AppData\Local\VirtualStore\Progr am Files (x86)\*.*

    to a location on a nas:

    \\nas1\\RdsVirtualStore

    Notice that there is a wild card between "Users" "AppData" because I have an unknown number of user profiles. So I want to only sync this selection from the "rds2" server to the "nas1" location. I have this script but nothing gets copied. The nas1 folder is empty to start.

    log normal "C:\BCompareLog3.txt"
    filter "VirtualStore\Program Files (x86)\*.*"
    load "\\rds2\c$\Users" "\\nas1\RdsVirtualStore"
    sync mirror:left->right

  2. #2
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,788

    Default

    Hello,

    First, I would strongly suggest testing filtering in the graphical interface. This way you can be sure the filters include/exclude what is needed before using a sync mirror (which can delete files as well as transfer them) executes. This can be done by loading the graphical interface, and copy/paste the script text into the two base folder paths to load the folders, then copy/paste the filter text in the Filters toolbar dropdown box. This applies the filter syntax to the loaded folder compare.

    The key is that your current include filter is not at the same folder level as the loaded base folders.
    \\rds2\c$\Users <-> \\nas1\RdsVirtualStore

    Would need a filter that includes the username or mask up to that point:
    .\*\AppData\Local\VirtualStore\Program Files (x86)\*.*

    (BC4 also has variable length with "...", but this doesn't sound like the style you need):
    .\...\AppData\Local\VirtualStore\Program Files (x86)\*.*

    Does this show only the Program File (x86) directory like you need? Or do you need to show a different data set?

    Once the correct items are Included or Excluded in your graphical interface test, you can then copy your base folder text and filter string back into scripting. I would suggest first testing with a folder-report generation (again, just to verify the data) before committing the sync, or working with already backed up data while testing out our scripting capabilities.
    Aaron P Scooter Software

  3. #3
    Join Date
    Jan 2011
    Posts
    4

    Default

    Quote Originally Posted by Aaron View Post
    Hello,

    (BC4 also has variable length with "...", but this doesn't sound like the style you need):
    .\...\AppData\Local\VirtualStore\Program Files (x86)\*.*
    Can you explain a little more what the ... does?

    If I want to match on all "db\*.mdb" if "db" folder is an unknown level of directories deep, would "..." do this?

    For example match all of these:
    .\*\AppData\Local\VirtualStore\Program Files (x86)\Milgard\db\m2o.mdb
    .\*\AppData\Local\VirtualStore\Program Files (x86)\db\m2o.mdb
    .\*\AppData\Local\VirtualStore\Program Files (x86)\map1\pf\gt\db\iq.mdb

    Would this do it:
    .\*\AppData\Local\VirtualStore\Program Files (x86)\...\db\*.mdb

  4. #4
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,788

    Default

    Hello,

    ".\..." means 'at any subfolder level'
    So this would match on \1\2\folder or 1\2\3\subfolder

    For more detailed documentation, if you are in the Session Settings dialog -> Name Filters tab, you can click '?' Help button next to 'X' Close, and this will bring you to a context sensitive help with syntax information.
    Aaron P Scooter Software

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •