Set options for Backup Copy job

PowerShell script exchange

Set options for Backup Copy job

Veeam Logoby oli4 » Mon Aug 31, 2015 8:57 am

Hello all

I try to change some settings of a Backup Copy job, with the Options:

- enable the Backup Copy job
- set Restore points to 30 days
- set VM retention to 40 days

But it doesnt seems to work like with a normal Backup job.

Regards
oli4
oli4
Enthusiast
 
Posts: 38
Liked: 2 times
Joined: Tue Aug 14, 2012 11:34 am

Re: Set options for Backup Copy job

Veeam Logoby PTide » Mon Aug 31, 2015 9:59 am

Hi,

But it doesnt seems to work like with a normal Backup job.
Please describe what result did you expect and how it differs from what you got.

Thank you.
PTide
Veeam Software
 
Posts: 3019
Liked: 246 times
Joined: Tue May 19, 2015 1:46 pm

Re: Set options for Backup Copy job

Veeam Logoby oli4 » Mon Aug 31, 2015 10:18 am

Hello

I try with this:

Code: Select all
$Job = Get-VBRJob -Name <Name of Backup Copy job>
$Options = $Job.GetOptions()
$Options.BackupStorageOptions.RetainCycles = 40
$Options.BackupStorageOptions.EnableDeletedVmDataRetention = $True
$Options.JobOptions.RunManually = $false
$Job.SetOptions($Options)

But it didn't change anything. As far as I understood for backup copy jobs you also have to use Get-VBRJob options.
oli4
Enthusiast
 
Posts: 38
Liked: 2 times
Joined: Tue Aug 14, 2012 11:34 am

Re: Set options for Backup Copy job

Veeam Logoby v.Eremin » Mon Aug 31, 2015 10:37 am

I think the following example should to the trick:

Code: Select all
$Job = Get-VBRJob -Name "Backup Copy Job 1"

#Enable a backup copy job
Enable-VBRJob -Job $Job

#Disable a backup copy job
Disable-VBRJob -Job $Job

$Options = $Job.GetOptions()

#Set simple retention to 30
$Options.GenerationPolicy.SimpleRetentionRestorePoints = "30"

#Enable deleted VM retention
$Options.GenerationPolicy.EnableDeletedVmDataRetention = $True

#Set deleted VM retention to 40
$Options.GenerationPolicy.DeletedVmsDataRetentionPeriodDays = "40"

#Apply new settings
$Job.SetOptions($Options)


Be aware that most of the backup copy job specific settings can be found under .Options.GenerationPolicy subnode.

Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Set options for Backup Copy job

Veeam Logoby oli4 » Mon Aug 31, 2015 12:22 pm

Thanks, with this it worked.
oli4
Enthusiast
 
Posts: 38
Liked: 2 times
Joined: Tue Aug 14, 2012 11:34 am

Re: Set options for Backup Copy job

Veeam Logoby v.Eremin » Mon Aug 31, 2015 12:27 pm

You're welcome. Let me know, if you come across any issue with scripting. Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 4 guests