A Regex or Regular Expression is a sequence of characters that define a search pattern. It’s mainly used for pattern matching. Each character in a regular expression is either understood to be a metacharacter -with it’s special meaning, or a regular character with it’s listeral meaning.
A basic understanding of regular expressions is recommended. For more information about the expressions and metacharacters which can be used, please refer to a regex cheat sheet. Various tools are available on the internet to test your regular expressions. For example: RegExPal.
CommVault allows the use of regular expressions to select the content for a particular subclient. This can be very useful in the following situations:
- In my case: I have a folder which stores the home folders (about 500 of them). To optimize the backup and the content indexing of the filesystem data, I divided the data by using some regular expressions.
- You only want to backup specific files. For example: *.bak.
In my case, the data is divided in different patterns. The data is stored on a NetApp network share which is backed up by using a Virtual Windows File System Agent.
- Exxxx for external accounts;
- Ixxxx for internal accounts;
- Txxxx for temporary accounts;
- Gxxxx for generic accounts.
I decided to keep the two largest parts apart (external & internal) and catch-all the rest in a catch-all principle. The configuration goes as follows:
- In the content section of subclient 1 (External) I filled in: “\\NA-filer\users$\E*“;
- In the content section of subclient 2 (Internal) I filled in: “\\NA-filer\users$\I*“;
- In the content section of subclient 3 (catch-all) I filled in: “\\NA-filer\users$\*” and on the filters tab, I added “”\\NA-filer\users$\E*” and “\\NA-filer\users$\I*“.
Update 9-JUL-2015: defining network shares in combination with regex in the Content section of the subclient, requires the use of UNC-NT_path type as some of the regex paths will not be applied.
- In the content section of subclient 1 (External) I filled in: “UNC-NT_NA-filer\users$\E*“;
- In the content section of subclient 2 (Internal) I filled in: “UNC-NT_NA-filer\users$\I*“;
- In the content section of subclient 3 (catch-all) I filled in: “\\NA-filer\users$\*” and on the filters tab, I added “”UNC-NT_NA-filer\users$\E*” and “UNC-NT_NA-filer\users$\I*“.
Schedule all subclients and you are good to go!
Thanks for reading!