PowerShell script exchange
Post Reply
matteu
Veeam Legend
Posts: 725
Liked: 118 times
Joined: May 11, 2018 8:42 am
Contact:

Set GFS for backup copy job

Post by matteu »

Hello,

The cmdlet Set-VBRJobOptions is not anymore supported to configure GFS on backup copy job.
How to configure it ?

If I do this, it doesn't work :

Code: Select all

$weekly = New-VBRComputerGFSWeeklyOptions -RetentionPeriod 3 -SelectedDay Wednesday
$monthly = New-VBRComputerGFSMonthlyOptions -RetentionPeriod 3 -SelectedWeek First
$yearly = New-VBRComputerGFSYearlyOptions -RetentionPeriod 2 -SelectedMonth November
$gfs = New-VBRComputerGFSOptions -GFSWeeklyOptions $weekly -GFSMonthlyOptions $monthly -GFSYearlyOptions $yearly

Set-VBRBackupCopyJob -Job $BackupCopyJob -RPOWarningOptions $BackupCopyRPO -GFSOptions $GFSOptions | Out-Null

The value of $gfs is empty and the cmdlet New-VBRComputerGFSOptions in the documentation indicates it's only for agent job.
matteu
Veeam Legend
Posts: 725
Liked: 118 times
Joined: May 11, 2018 8:42 am
Contact:

Re: Set GFS for backup copy job

Post by matteu »

OK forget it, I just didn't use the correct variables.
This one is working fine.

Set-VBRBackupCopyJob -Job $BackupCopyJob -RPOWarningOptions $BackupCopyRPO -GFSOptions $gfs | Out-Null
weeam
Influencer
Posts: 15
Liked: 2 times
Joined: Jan 25, 2019 2:35 pm
Contact:

Re: Set GFS for backup copy job

Post by weeam »

Hello Matteu,

I'm trying to update GFS yearly retention of all my copy job

$jobs = Get-VBRBackupCopyJob | Where-Object { $_.Name -like "TEST_VMWCOPY*" }
foreach ($job in $jobs) {
$yearly = New-VBRComputerGFSYearlyOptions -RetentionPeriod 5 -SelectedMonth January
$gfs = New-VBRComputerGFSOptions -GFSYearlyOptions $yearly
Set-VBRBackupCopyJob -Job $job -GFSOptions $gfs
}

yearly value has been updated successfully but I lost monthly and weekly value. Could you please help to keep values?

Thank you for your support.

Regards,
Eric
Leading Technology
matteu
Veeam Legend
Posts: 725
Liked: 118 times
Joined: May 11, 2018 8:42 am
Contact:

Re: Set GFS for backup copy job

Post by matteu »

You need to configure all thé value as I did in my code because the cmdlet will override existing configuration.
If you don t specify monthly and weekly, it will not be setup
Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests