New-VBRSelectedFilesLegacyPathMask

Short Description

Defines a legacy path mask to exclude folders from the backup scope of Veeam Agent backup jobs.

Product Edition: Community, Standard, Enterprise, Enterprise Plus, Veeam Universal License

Syntax

New-VBRSelectedFilesLegacyPathMask -Path <String> [<CommonParameters>]

Detailed Description

This cmdlet creates the VBRSelectedFilesLegacyPathMask object. This object defines a path mask in the format of the exclude masks of Veeam Backup & Replication 13.1 and earlier. You can use the mask only to exclude folders from the backup scope of a Veeam Agent backup job.

Veeam Backup & Replication creates masks of this type from the exclude masks of earlier versions that contain a path separator of the protected OS, for example /var/log* or C:\Temp\*. Exclude masks that contain only a file name or extension, for example *.tmp, become wildcard masks. The same conversion applies to the values of the obsolete ExcludeMask parameter.

Note that legacy path masks and path masks are evaluated differently. A legacy path mask excludes a folder as a whole, but a folder that is specified in the SelectedFiles parameter inside it is still backed up. Objects excluded by a path mask cannot be included again by any other setting. For new exclusions, use the New-VBRSelectedFilesPathMaskDefines a path mask for the backup scope of Veeam Agent backup jobs. cmdlet.

To apply the mask, set it as the ExclusionMask parameter value of the New-VBRSelectedFilesBackupOptionsDefines backup scope settings for Veeam Agent backup jobs. or Set-VBRSelectedFilesBackupOptionsModifies the backup scope settings for Veeam Agent backup jobs. cmdlet.

Note: You cannot use legacy path masks as the InclusionMask parameter value.

Parameters

Parameters

Parameter

Description

Type

Required

Position

Accept Pipeline Input

Path

Specifies the full path to the folders that you want to exclude from the backup scope. The mask matches only folders: files whose names match the mask are backed up. You can use wildcard characters only in the last element of the path, for example C:\Reports\Old*. You cannot use the ** recursive pattern.

For Windows computers, you can start the path with a system environment variable preceded by the backslash sign, for example \%TEMP%\logs.

String

True

Named

True (ByPropertyName, ByValue)

<CommonParameters>

This cmdlet supports Microsoft PowerShell common parameters. For more information on common parameters, see Microsoft Docs.

Output Object

The cmdlet returns the VBRSelectedFilesLegacyPathMask object that defines a legacy path mask for excluding folders from the backup scope.

Examples

New-VBRSelectedFilesLegacyPathMaskExample 1. Excluding Folder from Backup Scope Using Legacy Path Mask (Windows)

This example shows how to exclude the C:\Temp folder from the backup scope of a Veeam Agent backup job.

$mask = New-VBRSelectedFilesLegacyPathMask -Path "C:\Temp"

New-VBRSelectedFilesBackupOptions -OSPlatform Windows -BackupSelectedFiles -SelectedFiles "C:\" -ExclusionMask $mask

Perform the following steps:

  1. Run the New-VBRSelectedFilesLegacyPathMask cmdlet. Specify the Path parameter value. Save the result to the $mask variable.
  2. Run the New-VBRSelectedFilesBackupOptionsDefines backup scope settings for Veeam Agent backup jobs. cmdlet. Specify the following settings:
    • Set the Windows value for the OSPlatform parameter.
    • Provide the BackupSelectedFiles parameter.
    • Specify the SelectedFiles parameter value.
    • Set the $mask variable as the ExclusionMask parameter value.

New-VBRSelectedFilesLegacyPathMaskExample 2. Excluding Directory from Backup Scope Using Legacy Path Mask (Linux)

This example shows how to exclude the /home/user01/.cache directory from the backup scope of a Veeam Agent backup job that backs up a Linux computer.

$mask = New-VBRSelectedFilesLegacyPathMask -Path "/home/user01/.cache"

New-VBRSelectedFilesBackupOptions -OSPlatform Linux -BackupSelectedFiles -SelectedFiles "/home/user01" -ExclusionMask $mask

Perform the following steps:

  1. Run the New-VBRSelectedFilesLegacyPathMask cmdlet. Specify the Path parameter value. Save the result to the $mask variable.
  2. Run the New-VBRSelectedFilesBackupOptionsDefines backup scope settings for Veeam Agent backup jobs. cmdlet. Specify the following settings:
    • Set the Linux value for the OSPlatform parameter.
    • Provide the BackupSelectedFiles parameter.
    • Specify the SelectedFiles parameter value.
    • Set the $mask variable as the ExclusionMask parameter value.

Page updated 2026-11-17

Page content applies to build 13.2.0.193