Loading...

Supported Wildcards for the Windows File System

You can use a wildcard to represent one or more characters when you define the content for backups and filters for a subclient.

Note: If the subclient content consists of wildcard characters and no eligible files are found for the backup, the backup operation can still successfully complete.

Wildcards

Description

Example

*

Any number of characters.

Use this wildcard in the following scenarios

  • Back up all files of a specific extension
  • Back up all files under a specific directory
  • Back up all files with a specific file extension that start with the pattern

*.doc backs up all files with the extension .doc (for example, status.doc) on all drives on the client computer.

C:\Test\*.doc backs up all .doc files only in the C:\Test\directory.

a*.dll backs up all files with the extension .dll (for example, alsvc.dll, advdcc.dll) on the client computer thar has the name beginning with the letter "a".

C:\Finance\Test\* backs up only the files in the Test folder under the Finance folder on the C: drive. Any sub-folder under the Test folder will not be backed up.

 

?

A single character.

Use this wildcard in the following scenario:

  • All files (or directories) that match the character pattern before and after the ?

Tip: To match multiple characters, use a ? for each character that you want to match.

access? backs up any folder or file on the C: drive for which the name begins with- access followed by any one character such as access1 or access5. However, access12 or access15, for example, will not be backed up because the last two characters in the name are variables. To back up access12 or access15, you must specify access?? in the subclient content.

Class?report backs up any folder or file for which the wildcard character in the place of ? is a variable. For example: Class1report and Class2report are included in the backup. However, Class15report is excluded from backup.

[]

A range of characters.

Numbers within square brackets are treated as single digits, and a dash between two digits indicates the complete range of numbers between those two digits.

For example,

test[1-5].txt backs up all files test1.txt, test2.txt, test3.txt, test4.txt, and test5.txt.

test1[0-9][0-9][0-9].txt backs up all files starting from test1000.txt to test1999.txt.

To back up files test 10 to test 39, enter test[1-3][0-9]. If you enter [10-39], it would back up test1, test0, test3, and test9.

If you want to treat [] as literal characters and not as wildcards, you must use the special syntax. This is useful when you want to include a file that has brackets ( [] ) in the file name. The special syntax allows you to define an escape character. Each character immediately follows the escape character is treated literally and not as a wildcard character.

For example, you want to back up a file with the name report[finance].doc on the C: drive. To avoid treating the square brackets as wildcard characters, you must define the escape character. In the following example, "e=" syntax is used to define the escape character as the apostrophe (‘). The square brackets must be treated as literals and must be preceded by apostrophes. The content entry in the subclient should look like this:

<P:e='>C:\report'[finance'].doc

Any character can be used as the escape character, as long as it is defined after the “e=” in the syntax and it precedes any character that is to be treated as a literal.

In addition, the escape character can itself be used as a literal. This can be achieved by prefixing it with another escape character.

To back up a file with the name Test[Report]’2011’Financials.doc on the C drive, the following syntax should be used:

<P:e=’>C:\Test’[Report’]’’2011’’Financials.doc

To back up a directory folder[x] on the C drive, the following syntax must be used:

<P:e=~>C:\share\folder~[x~]\***

To back up directories folder[3], folder[4], and folder[5] on the C drive, the following syntax must be used:

<P:e=~>C:\DATA\folder~[[3-5]~]\***

To exclude directories folder[3], folder[4], and folder[5] on the C drive, the following syntax must be used:

<P:e=~>C:\DATA\folder~[[!3-5]~]\***

 

[!]

The negation of a set or range of characters.

Use the wildcard to back up all files in a directory  that do not match the characters specified in the wildcard.

C:\Windows\[!AEIOU]*.doc would backup all .doc files in the C:\Windows directory that start with a letter other than A, E, I, O, or U.

Last modified: 10/22/2019 2:19:29 PM