cancel
Showing results for 
Search instead for 
Did you mean: 

BEMCLI Exclude folder from backup

jankowalski
Level 0

Hi All

I am trying to create Selection for BackupJobDefinition like this:

$ExcludeDisksList = @("I:")
$ExcludePathsList = @("C:\Test1","C:\Test2")
$FileSystemSelection = $ExcludePathsList | % {$_} | New-BEFileSystemSelection -Recurse -Exclude -PathIsDirectory
$FileSystemSelection += Get-WmiObject Win32_Volume |? { $_.DriveType -eq 3 -and $_.DriveLetter -ne $null -and $ExcludeDisksList.Contains($_.DriveLetter) -ne $true } |%{ "$($_.DriveLetter)\" } | New-BEFileSystemSelection
    
$ServerName = $AgentServer.ToString().Split('.')[0]

New-BEBackupDefinition -BackupJobDefault BackupToDisk -SystemStateSelection Include -FileSystemSelection $FileSystemSelection...

And after creating the job folders that I want to exclude are still selected on list. Does anybody have an idea how to do it properly ? Thanks
   

1 REPLY 1

FlashBagMan
Level 2

You can get the Command reference help file from:

https://www.veritas.com/support/en_US/article.000004567

Have you tried to directly just manually create a job with excluded folders from BEMCLI without passing varibles?

From the command reference the example to exclude a directory looks like this:

New-BEFileSystemSelection Help

C:\PS> $x = "C:\Windows\*" | New-BEFileSystemSelection -Recurse -ExcludeExclude
C:\PS> Get-BEAgentServer -Local | Submit-BEOnetimeBackupJob -FileSystemSelection $x
 

These commands submit a one-time backup that backs up all of the data on the local computer with the exception of the C:\Windows directory.