Exclude rules syntax

When you are backing up file systems, you can define exclusion rules to exclude certain drives, directories, or files from backup jobs. These files are then not backed up as part of your SLA policy or as part of the ad hoc backup job you are running. When you run a restore job, the exclusion rules mean that 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 to each of the file systems that are being protected. If you want to define new rules for a particular file system instance, you can add to existing rules in the Manage Protection > File Systems > Microsoft Windows Windows Backup window. The new rules that you define for that file system backup job override the exclude rules set for Windows file systems. For more information about defining a backup job, see Backing up file system data.

If you want to exclude a file you can specify the name of the file like this Z:\test\excludedFile.txt. If you want to exclude all files in a folder you can specify a rule like this Z:\test\*. If you want to exclude a folder you can specify a rule like this DIR Z:\excludedFolder.
Table 1. Exclude rules syntax for Windows
Syntax Syntax behavior
:\
  • Indicates a file system and Windows drive.
  • Must be included in all rules except for the FS rule.
  • A rule cannot start or end with this syntax.
  • A rule must start with a drive letter or wildcard followed by this sequence.
\
  • Indicates the next directory level.
  • A rule cannot end with a backslash \ character.
\...\
  • Indicates that the rule applies on all directories below this level.
  • A rule cannot start or end with a \...\ sequence.
  • This sequence must be after the drive specification sequence.
*
  • This syntax is the wildcard for any character or for any number of characters. It is also used when no character is defined.
  • A rule can start or end with this syntax.
  • When used to indicate a drive letter, this syntax must be one alphabetic character.
  • This wildcard cannot be a backslash \ character.
?
  • This syntax is used as a wildcard for any character for one occurrence only.
  • A rule can start and end with this syntax.
  • When this syntax is used to indicate a drive letter, it must be an alphabetic character between A and Z.
DIR
  • This syntax indicates a directory rule, but it does not exclude any files in the affected directory.
  • This syntax must be a heading rule followed by a blank.
FS
  • Indicates that a full file system drive is excluded from the job.
  • This syntax must be followed by a drive letter that can be a single character or a wildcard.
Spaces
  • Spaces are allowed in file names or directory names.
  • A blank is not allowed before a backslash, \, or in a heading or trailing in a rule row.
  • Spaces are validated as single characters.
Uppercase and lowercase text Microsoft Windows is case-sensitive. Exclude rules ignore case.
Table 2. Valid exclude statements
Rule example  
*:\* This rule excludes all files from the file system root 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 not 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 that includes 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, such as Bobby.MP3, Bobby.MP4, and so on.
F:\Bobby.txt This rule excludes the file Bobby.txt in the file system root.
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. Files that are excluded ate 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 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 files system.
FS ? This rule excludes all drives.

Invalid exclude syntax

The following invalid syntax does not work in exclude rule definitions.
  • \no
  • *
  • \*
  • F:\no\
  • DIR \no
  • DIR F:\no\
  • DIR *
  • DIR F:\*\

To view the job log file, go to Jobs and Operations and open the Running Jobs tab. Find the newest Application Server Backup log entry.