Include/Exclude Filtering Examples

Note: You can synchronize Windows, Linux, Mac OS X, and other Unix-based endpoints and servers, but must take care with path separators. The path separator "/" is supported on Windows and other platforms. The path separator "\" is platform-agnostic only for the options -d/r/L/R/B/b and --keep-dir-local/remote. In Include/Exclude Filtering Rules, however, "\" is exclusively a quoting operator and "/" is the only path separator recognized.
  1. Include files under top-level directories Raw and Jpg. Exclude all others.
    > async ... --include='/Raw/**' --include='/Jpg/**' --exclude='*' \ 
    --exclude='.*' ...  
  2. Same as Example (1), except also include directories starting with ".", at any level.
    > async ... --include='.*/' --include='/Raw/**' --include='/Jpg/**' \ 
    --exclude='*' --exclude='.*' ...  
  3. Same as Example (2), except exclude regular files ending in "~" or ".thm".
    > async ... --include='.*/' --exclude='.*~' --exclude='*~' \
    --exclude='.*.thm' --exclude='*.thm' --include='/Raw/**' \
    --include='/Jpg/**' --exclude='*' --exclude='.*' ...  
  4. Same as Example (3), except include only certain directories under Jpg.
    > async ... --exclude='.*~' --exclude='*~' --exclude='.*.thm' \
    --exclude='*.thm' --include='.*/' --include '/Raw/**' \
    --include='/Jpg/Big/**' --include='/Jpg/Med/**' \
    --exclude='*' --exclude='.*' ...  

    Note that the long sequence in Example (4) can also be represented as a file (as shown below).

    > async ... --exclude-from=- <<EOF
    # no regular files with ~ suffix, dot or otherwise:
        .*~
        *~
    # similarly for ".thm" suffix files:
        .*.thm
        *.thm
    # include directories starting with "."
        + .*/  
    # include everything else found under top-level Raw :
        + /Raw/**
    # and under Big/ and Med/ in Jpg:
        + /Jpg/Big/**
        + /Jpg/Med/**
    # but nothing else:
        *
        .*
    EOF