Include and exclude groups of files with wildcard characters
You can use wildcard characters to include or exclude groups of files.
To specify groups of files that you want to include or exclude, use the wildcard characters listed in the following table. This table applies to include and exclude statements only.
A very large include-exclude list can decrease backup performance. Use wildcards and eliminate unnecessary include statements to keep the list as short as possible.
Character | Function |
---|---|
? | The match one character matches any
single character except the directory separator; it does not
match the end of the string. For example:
|
* | The match-all character. For example:
|
\... | The match-n character matches zero or
more directories. The
following pattern specifies all files in the root directory of the C drive:
The following pattern specifies all
files and all directories on the C
drive:
|
/... | The match-n character matches zero or more directories. |
[ | The open character-class character
begins the enumeration of a character class. For example:
|
– | The character-class range includes
characters from the first character to the last character specified.
For example:
This format should not be used to specify remote drives in an exclude statement. |
\ | The literal escape character. When used within a character class, it treats the next character literally. When used outside of a character class, it is not treated in this way. For example, if you want to include the ']' in a character class, enter [...\]...]. The escape character removes the usual meaning of ']' as the close character-class character. |
] | The close character-class character ends the enumeration of a character class. |
: | The drive separator character separates a file specification. The
character before the colon identifies a drive letter. The characters after the colon
identify file specification or pattern.
For
example:
|
Note: Because a drive specification can consist
of only one letter, you should not use more than one wildcard or a
combination of a wildcards with a letter to designate a drive specification.
The following patterns are not allowed, and if specified in the client
options file (dsm.opt), stops the client program immediately after
it starts:
- ?*:\test.txt
- *?:\...\pagefile.sys
- H*:\test.*
- *H:\test.txt
- myvolume*:\
- myvolume?*:\
If you are using UNC names, Table 2 shows how to correctly
specify shared drives.
Incorrect | Correct |
---|---|
\\remote\*:\...\*.* | \\remote\*$\...\*.* |
\\remote\?:\...\*.* | \\remote\?$\...\*.* |
\\remote\*:\...\pagefile.sys | \\remote\*$\...\pagefile.sys |