PowerShell script exchange
Post Reply
efd121
Enthusiast
Posts: 49
Liked: 2 times
Joined: Aug 07, 2015 8:45 pm
Full Name: David Engler
Contact:

Set-VBRJobOptoins updating RetainCycles

Post by efd121 »

I'm attempting to set the number of retentions on a Backup Copy job to the same value as the Backup job but I'm having dificulty with the Set-VBRJobOptions
The section of code below runs without any errors but the # of restore points is not updated from the default of 7
I added the Write-Host line to confirm it should be changing the value to 14.

Any suggestions on what I'm doing wrong?

Code: Select all

# Find # of restore points in Backup Job then update BCJob with same # retentions
$tmpJob = Get-VBRJob -Name "TestJob1"
$RestorePoints = $tmpJob.Options.BackupStorageOptions.RetainCycles
$JobOptions = "BCTestJob1" | Get-VBRJobOptions
$JobOptions.BackupStorageOptions.RetainCycles = $RestorePoints
Write-Host "JobOptions=" $JobOptions.BackupStorageOptions.RetainCycles -ForegroundColor Yellow
Set-VBRJobOptions -Job "BCTestJob1" -Options $JobOptions
efd121
Enthusiast
Posts: 49
Liked: 2 times
Joined: Aug 07, 2015 8:45 pm
Full Name: David Engler
Contact:

Re: Set-VBRJobOptoins updating RetainCycles

Post by efd121 » 1 person likes this post

I have been doing some more research on this and I think I have found why it appears my script was not running.

It appears that Options.BackupStorageOptions.RetainCycles is the value used for the number of restore points for Backup Jobs

And GenerationPolicy.SimpleRetentionRestorePoints is used for Backup Copy Jobs

Can anyone confirm my results?

Dave
veremin
Product Manager
Posts: 20283
Liked: 2258 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Set-VBRJobOptoins updating RetainCycles

Post by veremin »

Can anyone confirm my results?
Correct. The retention setting of backup copy job are present in GenerationPolicy parameters' group. Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests