Most users will wish to make selections and de-selections using the GUI as described here. However, you can also edit the .SEL file via enabling Expert mode, and going to the Text Selection tab of the GUI, or you can also edit the Text Selection file from the web console.
However, the engine actually uses a Unicode text file and so there are times when one may wish to view and exit actual selections. Be sure you edit and save this file as Unicode (or UTF8) encoded!
The selections file contains distinct sections corresponding to the distinct daily backup selection sets one can specify on the Backup->Selections tab in the pull-down menu. These sections are: [Everyday], [Sunday], [Monday], [Tuesday], [Wednesday], [Thursday], [Friday], [Saturday], [Weekdays], and [Weekend]. Below is an example of different selections for Tuesday and Wednesday:
[Tuesday]
+ \\?\E:\test#123\judy2.rtf
[Wednesday]
+ \\?\E:\test#123\zach.rtf
where the syntax of the above selections is described below.
International customers can change the definition of Weekend (which defaults to Saturday & Sunday) and Weekdays using the INI keywords weekend and weekdays.
The backup client can end up using multiple selection sets for any given day (though when you select a day/set in the user interface you are editing only that set). So, as an example, if the day the backup has been launched on is a Saturday, then in the user interface you will be editing just those selections unique to that day, but the engine will do the following
- If selections have been specified for 'Saturday', then those selections will be used.
- If there are selections for 'Weekend', then those selections will be used as well.
- If there are selections for 'Everyday' then those selections will be used as well.
Microsoft Windows does not allow the following characters in a file or folder name: < > : " / \ | ? * : although if you may have a mounted UNIX or Macintosh file system which allows one or more of these characters, so beware!
The syntax of a selections file is relatively straightforward. The first non-blank character on a line indicates what the line is
# the line is a comment
+ the line is a selection
- the line is an exclusion (de-selection)
You may use Windows wildcards (such as * and ?) in selections.
Microsoft Windows do not support wildcards on multiple directories, so, for example, the following doesn't work: C:\*\*.txt
You may use environment variables in selections and de-selection by embedding them between %, so, for example, %AppData%. As a convenience, you can use the variable %HOMEUSERS% in your default selections file (specified when you create a white label client) and it will be converted at software install time to C:\Users or C:\Documents and Settings (whatever is appropriate for the machine).
The environment variables must be defined for the user the service runs as, and so for example, the LocalSystem user may not have the environment variable you specified defined!
Microsoft Windows creates a special registry key, HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\BackupRestore\FilesNotToBackup, which the software client will use to perform file exclusions, including on VSS System Component selections as per Microsoft's specification.
In the GUI you can view the selections actually used for a backup on the Monitor->Details->Selections tab as shown here.
When you put a '/s' on the end of a selection or exclusion, that means that the operation applies to all sub-folders of the selection. If no '/s' is present then the operation only applies to the contents of the folder specified. A '/s' after a file is ignored.
In the selection file you may see files and folders with a "\\?\" prepended. This is Microsoft's way of specifying long pathnames (if they are not used then Microsoft limits a pathname to be 255 characters).
When selections are saved in the GUI they will automatically be categorized. The following shows one exclusion and 4 selections:
+ \\?\C:\Users\*\Documents /s
The first selection has a '/s' so all contents of subfolders within E:\data will be backed up, whereas the second selection is missing the '/s' so only the contents of C:\Apps will be backed up and not any subfolders.
Note how the third selection above is a network share (it has \\?\UNC\ prepended on it which allows specification of long pathnames for network shares) -- it could also have been written as \\WIN-6POAA8S1JV2\share\keydata\ /s
The fourth selection shows our syntax for selecting a Disk Image Backup of a Physical Drive. This selection will allow for the streaming backup of the disk image without needing to create the image first, and without the need for a lot of cache space to process the file. Note the trailing back slash without the need for the '/s' at the end of the line.
The last selection above is for a VSS System Component (in this case for Microsoft SQL Server). Please visit this article to learn more about VSS System Components.
The last selection above provides an example of using wildcards in selections.
Regular Expressions
In addition to supporting Windows wildcards and environment variables, WholesaleBackup also supports regular expressions, which are like wildcards but much more powerful (though there is a performance penalty for using regular expressions during the scan phase). Regular expressions are surrounded by '<' and '>' in selections and de-selections.
There are two forms of regular expressions used, the first is a simple deselection filter such as:
- <.*\.(bak)$>
where the initial '.*' indicates match zero or more characters, then the '\.' indicates to match the character '.', then the '(bak)' says to match 3 consecutive characters 'bak' and finally the '$' indicates the end of the string. So basically, this expression says to deselect any file which ends in '.bak' (or '.BAK' since Windows file names are case insensitive). Using the or '|' operator, a more complex and powerful deselection filter would be
- <.*\.((bak)|(TMP)|(TEMP)|(LCK)|(LOCK))$>
which will deselect any filename which ends in .BAK, .TMP, .TEMP, .LCK, or .LOCK. If you wish to include a folder separator '\' (or a '$') in a regular expression, it must be escaped by a '\' as well, so use '\\' (or '\$') such as in the following filter:
- <.*((\.Trash)|(\.Trashes)|(\$Recycle\.Bin)|(\\RECYCLER\\))>
More complex regular expressions are used within file or folder paths as part of a selection or deselection, which we refer to as path expressions. Path expressions must be surrounded by double-quotes '"'. The following is a simple example of a path expression used as selection:
+ "\\?\C:\Data\<(AB).*>\" /s
which says to select every folder beginning with AB in the C:\Data. Please note that using Windows wildcards for this example would be much faster and look like the following, and so:
+ \\?\C:\Data\AB*\ /s
In general, if you can make your selection or deselection using Windows wildcards instead of regular expressions, the time the software client spends in the scan phase will be less. Also, please remember to embed path expressions within double-quotes '"' as shown above.
Regular Expression Syntax
Value |
Meaning |
\ |
Quote (escape) the next character |
^ |
Match the beginning of the string |
. |
Match any character |
$ |
Match the end of the string |
| |
Or |
() |
Group |
[] |
Class |
Regular Expression Closures
Closure |
Meaning |
* |
Match 0 or more times |
+ |
Match 1 or more times |
? |
Match 1 or 0 times |
{n} |
Match exactly n times |
{n,} |
Match at least n times |
{n,m} |
Match at least n but not more than m times |
Regular Expression Escape Characters
Character |
Meaning |
\t |
tab(HT, TAB) |
\n |
newline(LF, NL) |
\r |
return(CR) |
\f |
form feed(FF) |
Regular Expression Predefined Character Classes
Class |
Meaning |
\l |
lowercase character |
\u |
uppercase character |
\a |
letter [a-zA-Z] |
\A |
non-letter |
\w |
alphanumeric [0-9a-zA-Z] |
\W |
non-alphanumeric |
\s |
space |
\S |
non-space |
\d |
digits [0-9] |
\D |
non-nondigit |
\x |
hexadecimal digit [0-0a-fA-F] |
\X |
non-hexadecimal digit |
\c |
control character |
\C |
non-control character |
\p |
punctation |
\P |
non-punctation |
\b |
word boundary |
\B |
non-word boundary |