It appears we could use some clarification on how to manage GFS trough powershell for backupCopy jobs. In my use case I would like to use powershell to enable GFS for a copyjob that currently is set to a ‘simple’ retention policy.
On first glance I found the ‘New-VBRGFSRetentionPolicy’ and the ‘Set-VBRGFSRetentionPolicy’ commands in the documentation that seemed promising and are geared for copyjobs.
However the ‘Set-VBRGFSRetentionPolicy’ only seem to allow me to modfy a GFS policy if GFS was already enabled because if I do it returns the error:
Code: Select all
$job = Get-VBRBackupCopyJob -Name 'LAB2 - Backup Copy'
$policy = Get-VBRRetentionPolicy -Job $job
Set-VBRGFSRetentionPolicy -RetentionPolicy $policy -RestorePoints 5 -GFSWeeklyBackups 8 -GFSMonthlyBackups 4 -GFSYearlyBackups 9
"Veeam.Backup.PowerShell.Infos.VBRGFSRetentionPolicy".
So I assume I have to use the ‘New-VBRGFSRetentionPolicy’ command to create a new policy. However there appears to be no way to target the new policy object to a particular job. If I ran the following code, how would it know what job to apply it to?
Code: Select all
$policy = New-VBRGFSRetentionPolicy -RestorePoints 2 -GFSWeeklyBackups 3 -GFSMonthlyBackups 4 -GFSQuarterlyBackups 5 -GFSYearlyBackups 9
Set-VBRGFSRetentionPolicy -RetentionPolicy $policy
Thanks in advance!