Exclude rules syntax
You can define exclusion rules to exclude specified drives, directories, or files from backup jobs. After you define the rule, the specified items are not backed up as part of your SLA policy or as part of an ad hoc backup job. When you run a restore job, the drives, directories, or files that are specified in the exclude rules are not restored to the new copy.
Exclude rules can be defined for the entire Windows file systems application. Rules that define the excluded resources are inherited by each file system that is being protected. To define new rules for a particular file system instance, you can add a rule in the File systems window. Select the file system servers that you want to add the rules for. The new rules that you define for that file system backup job override the exclude rules that are set for Windows file systems.
For more information about defining a backup job, see Backing up file system data.
To exclude a file, specify a rule as shown in the following example: Z:\test\excludedFile.txt.
To exclude all files in a folder, specify a rule as shown in the following example: Z:\test\*.
To exclude a folder and its files, specify a rule as shown in the following example: DIR Z:\excludedFolder.
If you use global variables for certain directories, you can use those variables
to exclude items regardless of their location. For example, if you wanted to exclude a directory
that is called Blues owned by the registered user, you can specify DIR
%USERPROFILE%\Blues. For more information about using global variables
to exclude resources, see Table 2.
| Syntax | Syntax behavior |
|---|---|
| :\ |
|
| \ |
|
| \...\ |
|
| * |
|
| ? |
|
| DIR |
|
| FS |
|
| Spaces |
|
| Uppercase and lowercase text | Microsoft Windows is case-sensitive. Exclude rules ignore case. |
| Syntax | Syntax behavior |
|---|---|
| DIR %PROGRAMDATA% |
|
| DIR %USERPROFILE% |
|
| DIR %PROGRAMFILES% |
|
| DIR %WINDIR% |
|
| Rule example | Result |
|---|---|
| *:\* | This rule excludes all files from the file system root directory from all drives, but does not exclude the directories. |
| DIR *:\* | This rule excludes all directories from all drives, but does not exclude the files in the root directory. |
| DIR E:\...\*temp* | This rule excludes all directories that start with temp in the directory name in all directories of the E: drive. |
| DIR F:\Users\Bobby\* | This rule excludes all content from the Bobby directory without excluding that directory itself. Files in the Bobby directory are excluded. |
| DIR F:\Users | This rule excludes all users who are listed in the Users directories and also excludes the Users directory. |
| DIR F:\Users\Bobby M?gee | This rule excludes all directories that match the name with a wildcard for one letter. This rule excludes users with names like Magee, Megee, Migee, and so on. |
| DIR F:\Users\Bobby Magee | This rule excludes the directory for the user who is defined, in this case Bobby Magee. With this rule, the directory for that user and all its content, including files and subfolders, are excluded. |
| F:\...\* | This rule excludes all files from the F:\ drive, but it does not exclude the directories. |
| F:\Bobby.mp? | This rule excludes all files that match Bobby.mp? in the file system root
directory, such as Bobby.MP3, Bobby.MP4, and so on. |
| F:\Bobby.txt | This rule excludes the file Bobby.txt in the file system root directory. |
| F:\Users\...\*.mp3 | This rule excludes all MP3 files for all users that are listed in the F drive. |
| F:\Users\Bobby\...\*.mp3 | This rule excludes all MP3 files from the user directory Bobby. |
| F:\Users\Bobby\...\*music*\...\*.mp? | This rule excludes all MP files in all directories that have the word music in the directory name for user Bobby. The excluded files are MP2, MP3, MP4, and so on. |
|
F:\Users\John\* DIR F:\Users\John\* |
This rule combination excludes all files and all subdirectories for the user John, but does not exclude the John directory itself. |
| F:\Users\John\tax\Tax_20??.pdf | This rule excludes all documents that match the pattern Tax_20 in the John\tax directory. Files that are named like these are excluded, TAX_2000.pdf, TAX_2019.pdf, and so on. |
|
FS F |
This rule excludes the file system F drive. |
| FS * | This rule excludes all drives in the file system. |
| FS ? | This rule excludes all drives. |
Invalid exclude syntax
- \no
- *
- \*
- F:\no\
- DIR \no
- DIR F:\no\
- DIR *
- DIR F:\*\
To verify the results of an exclude rule, view the job log file. In the navigation pane, click Jobs and Operations and open the Running Jobs tab. In the Application Server Backup section, find the newest log entry.