PowerShell script exchange
Post Reply
karim
Enthusiast
Posts: 51
Liked: 5 times
Joined: Oct 17, 2018 9:01 am
Contact:

restore points to keep for backup copy jobs

Post by karim »

Hello,
i'm using Backup & Replication 9.5.0.1922

i'm trying to create several backup copy job with powershell but i can't find how to modify the value for restore points to keep !
i tried this :

Code: Select all

$copyjob_name = Get-VBRJob -name "c_infras_30j"
$options = New-VBRJobOptions -ForBackupJob
$options.BackupStorageOptions.RetainCycles = 30
Set-VBRJobOptions -Job "$copyjob_name" -Options $options
but the restore point value is not applied (7 by default).

these lines works perfectly for a backup job.

can you help me to find the correct option ?

thank you for your replies.
Vek17
Service Provider
Posts: 49
Liked: 15 times
Joined: May 29, 2018 8:42 pm
Contact:

Re: restore points to keep for backup copy jobs

Post by Vek17 »

You are looking for

$Options.GenerationPolicy.SimpleRetentionRestorePoints
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: restore points to keep for backup copy jobs

Post by veremin »

The script should look like this:

Code: Select all

Asnp VeeamPSSnapin
$Job = Get-VBRJob -name "Name of your backup copy job"
$Options = $Job.GetOptions()
$Options.generationPolicy.SimpleRetentionRestorePoints = "Number of restore points to keep"
Set-VBRJobOptions -Job $Job -Options $Options
Thanks!
karim
Enthusiast
Posts: 51
Liked: 5 times
Joined: Oct 17, 2018 9:01 am
Contact:

Re: restore points to keep for backup copy jobs

Post by karim »

it works! thank you very much.
Post Reply

Who is online

Users browsing this forum: No registered users and 17 guests