Using Filters in Backup Jobs for Windows Computers
When you create or edit a Veeam Agent backup job for a Microsoft Windows computer in the Veeam Backup & Replication console, you can include and exclude files and folders from the backup job scope by using include and exclude masks as described in section Specifying Folders to Back Up. This topic demonstrates several basic scenarios you may want to implement in your infrastructure.
Before you configure filters, consider the following:
The settings of a backup job created by Veeam Agent operating in the managed mode provide additional file filtering capabilities compared to the settings available for a backup job created by Veeam Agent operating in the standalone mode. For example, when you create a backup job in the Veeam Backup & Replication console, you can specify paths and system environment variables in exclude masks. To learn more about setting up file filters for backup jobs when Veeam Agent operates in the standalone mode, see the How to Use Filters to Define File-Level Backup Scope section in the Veeam Agent for Windows User Guide.
- All backup scenarios in this topic are performed in the file-level backup mode.
A file-level backup job may contain entire volumes and individual folders or files from the other volumes (this is referred to as hybrid backup job). In this case, entire volumes are processed using volume-level backup mode while specific folders from other volumes are processed using file-level backup mode. In the hybrid backup job, filters work in the following way:
- File name and file type masks are applied only to the folders specified in the backup scope and not the entire volumes.
- Masks that contain paths are applied to the selected folders and entire volumes.
- Depending on the type of the object in the backup scope, during job execution Veeam Agent behaves differently:
- When you select an entire volume as an object of a file-level backup, Veeam Agent adds backup exclusions to the FilesNotToSnapshot registry key, triggers creation of the volume shadow copy (VSS snapshot), reads data from the VSS snapshot and saves the data to a backup repository.
To learn more about the FilesNotToSnapshot registry key, see this Microsoft article.
During backup, Veeam Agent will ignore any filters configured for this volume.
NOTE |
By default, Microsoft Windows does not include some files into the VSS snapshot — for example, temporary files, Microsoft Outlook .ost files and so on. As a result, these files are not included into Veeam Agent backups too. To learn how you can override this default behavior, see this Veeam KB article. |
- When you select an individual folder as an object of a file-level backup, Veeam Agent reads all data from the VSS snapshot first, then applies filters defined in the job configuration to save the data.
- When you specify include masks, the backup will contain only the data that matches these masking criteria within the backup scope. When you specify exclude masks, the backup will contain all data from the backup scope except the data that matches these masking criteria.
Setting Up File Filters for Backup Scope
To specify file filters when you create a new backup job, do the following:
You can apply filters only to the folders included in the backup scope.
NOTE |
You cannot apply filters to Operating system folders. |
- Excluding a Folder Using Full Path.
- Excluding a Folder Using an Environment Variable in the Path.
- Excluding a Folder Using a Wildcard Character in the Path.
- Including or Excluding Specific Files.
- Including or Excluding Files by File Type.
- Including or Excluding Files Whose Names Contain a Specific Sequence of Characters.
- Including or Excluding Files Named According to a Convention.
Excluding a Folder Using Full Path
As a result, the backup will contain all data from the backup scope except the E:\Data\2023 folder.
Excluding a Folder Using an Environment Variable in the Path
IMPORTANT |
When you specify a system environment variable in a mask, you must precede such variable with a backslash. |
NOTE |
If you use a system environment variable in the file filter for the backup, consider the following:
|
Excluding a Folder Using a Wildcard Character in the Path
To exclude a folder from the backup, you can specify a partial path with a wildcard at the end.
NOTE |
Note that you cannot use a wildcard in the middle of the path. For example, specifying E:\*\2023 will cause an error during backup. To recursively exclude files from specific subfolders of the selected root folder, you can use the standard OS mechanism for exclusions. |
Including or Excluding Specific Files
As a result, the backup will contain only the Image_05.bmp file from the specified backup scope.
Including or Excluding Files by File Type
In this example, we will back up all text files in the .txt format. To do this:
As a result, the backup will contain all the text files in the .txt format from the backup scope.
|
You can combine include and exclude masks as needed. For example, you can include all .pdf files into the backup scope and exclude the ones that contain the word draft in their name by specifying *.pdf in the include mask and *draft* in the exclude mask. |
Including or Excluding Files Whose Names Contain a Specific Sequence of Characters
Including or Excluding Files Named According to a Convention