PowerShell script exchange
Post Reply
yannik
Novice
Posts: 3
Liked: never
Joined: Jun 03, 2022 8:17 am
Full Name: Yannik Wölfl
Contact:

cannot get GFS retetnion with Get-VBRRetentionPolicy

Post by yannik »

I want a script to check Retention Policy especially GFS retention of backup copy job.

My code:

Code: Select all

$job = Get-VBRJob -Name "Job Name"
$job.JobType
Get-VBRRetentionPolicy -Job $job
On our Veeam Server I get a desired result (Version: 12.0.0.1420 P20230718):
SimpleBackupCopyPolicy

RestorePoints : 14
GFSWeeklyBackups : 4
GFSMonthlyBackups : 0
GFSQuarterlyBackups : 0
GFSYearlyBackups : 0
Type : GFS
On a customer Veeam Server I don't get the GFS retention, even I see in the GUI it is configured. why? (Version: 12.1.0.2131):
SimpleBackupCopyPolicy

RestorePoints Type
------------- ----
7 Simple
david.domask
Veeam Software
Posts: 1226
Liked: 322 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: cannot get GFS retetnion with Get-VBRRetentionPolicy

Post by david.domask »

Hi @yannik.

https://helpcenter.veeam.com/docs/backu ... ml?ver=120

This is for Backup Copy jobs from External Repositories -- I'm afraid that it worked before is a surprise for me :)

Use Get-VBRBackupCopyJob for v12 and on, it has a property GFSOptions:

Code: Select all

$job = Get-VBRBackupCopyJob -Name '12.1-backup-copy'
$job | Select @{n="WeeklyEnabled?";e={$_.GFSOptions.WeeklyGFSEnabled}},@{n="WeeklyRetention?";e={$_.GFSOptions.Weeklyoptions.RetentionPeriod}},@{n="MonthlyEnabled?";e={$_.GFSOptions.MonthlyGFSEnabled}},@{n="MonthlyRetention?";e={$_.GFSOptions.Monthlyoptions.RetentionPeriod}},@{n="YearlyEnabled?";e={$_.GFSOptions.YearlyGFSEnabled}},@{n="YearlyRetention?";e={$_.GFSOptions.Yearlyoptions.RetentionPeriod}}


WeeklyEnabled?    : True
WeeklyRetention?  : 7
MonthlyEnabled?   : False
MonthlyRetention? : 5
YearlyEnabled?    : False
YearlyRetention?  : 6
That Select-Object code block is of course overloaded, but more an example on how you can retrieve this. I would recommend instead make a function that just accepts a VBRBackupCopyJob object from Get-VBRBackupCopyJob and just parses out the data you want to see.
David Domask | Product Management: Principal Analyst
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 13 guests