PowerShell script exchange
matteu
Veeam Legend
Posts: 824 Liked: 128 times
Joined: May 11, 2018 8:42 am
Contact:
Post
by matteu » Jan 28, 2024 5:42 pm
this post
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: 824 Liked: 128 times
Joined: May 11, 2018 8:42 am
Contact:
Post
by matteu » Jan 28, 2024 8:09 pm
this post
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: 17 Liked: 3 times
Joined: Jan 25, 2019 2:35 pm
Contact:
Post
by weeam » Feb 08, 2024 5:07 pm
this post
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: 824 Liked: 128 times
Joined: May 11, 2018 8:42 am
Contact:
Post
by matteu » Feb 08, 2024 5:15 pm
1 person likes this post
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
Users browsing this forum: No registered users and 12 guests