Understanding Exclusion Patterns

Setting up your exclusions is an important configuration in FlexRAID and in particular when using Snapshot RAID.
The exclusion pattern tells FlexRAID which file to ignore, which is usually because of their transient states.

  • Ex1: /path1;/path2;…;/pathX (only the specified files will be excluded)
  • Ex2: /path1* (all files starting with /path1 will be excluded)
  • Ex3: *something/MyEndingPath (all files ending with something/MyEndingPath will be excluded)
  • Ex4: [RegExp]MyRegularExpressionPattern (this will use regular expression for matching)
  • Ex5: [minSize]xxxx (file size matching – this will filter out all files with size less than the specified minimum size)
  • Ex6: [hidden] (hidden files or folders will be ignored)

Of course, you can mix and match the patterns:

  • Ex5: /Path1;*.mp3;[RegExp]MyRegularExpressionPattern

In FlexRAID 2.1, the following exclusion patterns are defined by default for Windows users: [hidden];*\RECYCLED;*\RECYCLER\S-*;*\$Recycle.bin;*\System Volume Information.
These patterns ignore hidden files and folders, recycle bin data, and System Volume Information data.

On Linux, files and folders starting with a dot are ignored with the default exclusion pattern of: */.*.
Files and folders starting with a dot are assumed to be hidden files on Linux.

If you are using tools such as MyMovies and others that maintain metadata information, you would want to include additional matches to exclude.
Here is an example of a user excluding files frequently updated by MyMovies: http://www.openegg.org/forums/posts/list/262.page#7050

Negating exclusion patterns:

Exclusion patterns can also be negated.
To negate a pattern, simply add a ‘!‘ to the pattern (Ex: !*.jpg or ![RegExp]…).

Simple exclusion patterns:

The simple FlexRAID patterns only do: startsWith (xxx*), endsWith (*xxx), contains (*xxx*), equals (xxx), minimum file size matching ([minSize]xxx), and hidden file and folder matching ([hidden]).
The simple patterns are for people that don’t want to do regular expressions. Regular expressions are powerful and will allow you to do almost anything you want (except file size and hidden matching).

Regular Expression exclusion patterns:

Regular expressions can even do negation on their own. So, you don’t have to use FlexRAID’s negation syntax with regular expressions, but you can if it simplifies things.

Applying patterns to files only or folders only:

By default, exclusions apply to both files and folders. To have an exclusion syntax apply only to files or to folders only, the following directives are supported:

  • @all: apply to both files and folders (when no directive @all is assumed – e.g., @all[hidden])
  • @files: apply pattern to files only (e.g., @files*.jpg)
  • @folders: apply pattern to folders only (e.g., @folders*\$RECYCLE.BIN)

Another example:

@folders![RegExp](C:|D:)\\shares\\(Photos|Videos);@folders*\RECYCLED;@files*\RECYCLER\S-*;@all*-temporary-*

More examples:

Regular expressions can be tested here: http://regexpal.com/

This will match C:\Whatever\Media\Movie\Bluray\folder.jpg
@files[RegExp].+(\\Media).+(\\Bluray).+\.(jpg|jpeg|xml)

Careful! To match C:\Whatever\Media\Bluray\folder.jpg, you need:
@files[RegExp].+(\\Media)(\\Bluray).+\.(jpg|jpeg|xml)

Be Sociable, Share!

Tags:

One Response to “Understanding Exclusion Patterns”

  1. vletroye February 3, 2013 at 5:45 AM #

    I found in the forum that to exclude a folder in the root of the Pool Drive (E.g.: “:\Folder”), one can use the following syntax when using the Cruise Control mode: “*}\Folder”

    This is to match the folder on any drive mounted in the pool (I.e.: mounted on a folder like C:\FlexRAID-Managed-Pool\class1_0\{}\ )

Leave a Reply

thirteen − nine =