Veeam 7 set Compact Full Backup File Option

PowerShell script exchange

Veeam 7 set Compact Full Backup File Option

Veeam Logoby sidavid » Wed Sep 18, 2013 11:18 am

Hi,

I want to set the Compact Full Backup File option, but I'm unable to select the day. What do I miss?

Code: Select all
$job = Get-VBRJob -Name Test
$option = $job.GetOptions()
$option.GenerationPolicy.EnableCompactFull = $True
$option.GenerationPolicy.CompactFullBackupDays = "Saturday" (This option is not working, the option stay at the Monthly First Monday)
$job.SetOptions($job.Options)

Thanks

David
sidavid
Enthusiast
 
Posts: 60
Liked: never
Joined: Sun Jan 01, 2006 1:01 am

Re: Veeam 7 set Compact Full Backup File Option

Veeam Logoby v.Eremin » Wed Sep 18, 2013 11:33 am

Hi, David.

The script you’ve written affects weekly schedule of compact full backup, instead of monthly one. The following script should do the trick:

Code: Select all
asnp VeeamPSSnapin
$Job = Get-VBRJob -name "name of a backup copy job"
$Options = $Job.GetOptions()
$Options.GenerationPolicy.CompactFullBackupMonthlyScheduleOptions.DayOfWeek = "6"
$Job.SetOptions($Options)


Hope this helps.
Thanks.
v.Eremin
Veeam Software
 
Posts: 13296
Liked: 974 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Veeam 7 set Compact Full Backup File Option

Veeam Logoby sidavid » Wed Sep 18, 2013 11:54 am

Hi,

I have tried and receive the following error:

Property 'DayOfWeek' cannot be found on this object; make sure it exists and is
settable.
At C:\Veeam-Scripts\Extra-Scripts\veeam\backupcopyjob-compactbackup.ps1:4 char:
67
+ $Options.GenerationPolicy.CompactFullBackupMonthlyScheduleOptions. <<<< DayOf
Week = "1"
+ CategoryInfo : InvalidOperation: (DayOfWeek:String) [], Runtime
Exception
+ FullyQualifiedErrorId : PropertyNotFound

Thanks for your quick reply
sidavid
Enthusiast
 
Posts: 60
Liked: never
Joined: Sun Jan 01, 2006 1:01 am

Re: Veeam 7 set Compact Full Backup File Option

Veeam Logoby v.Eremin » Wed Sep 18, 2013 11:58 am

I’ve missed the part that enables compact full backup. So, the final version should look like this:

Code: Select all
asnp VeeamPSSnapin
$Job = Get-VBRJob -name "name of backup copy job" # specify a name of your backup job here
$Options = $Job.GetOptions()
$Options.GenerationPolicy.EnableCompactFull = $True
$Options.GenerationPolicy.CompactFullBackupMonthlyScheduleOptions.DayOfWeek = "6"
$Job.SetOptions($Options)


Hope this helps.
Thanks.
v.Eremin
Veeam Software
 
Posts: 13296
Liked: 974 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Veeam 7 set Compact Full Backup File Option

Veeam Logoby sidavid » Wed Sep 18, 2013 12:12 pm

Yes this works but maybe I do not explain correctly, I do not want the Monthly option I want that my backup copy job is compact every week. (The option under the monthly one).
Thanks
sidavid
Enthusiast
 
Posts: 60
Liked: never
Joined: Sun Jan 01, 2006 1:01 am

Re: Veeam 7 set Compact Full Backup File Option

Veeam Logoby v.Eremin » Wed Sep 18, 2013 1:05 pm

Ok, then, this script should help:

Code: Select all
asnp VeeamPSSnapin
$Job = Get-VBRJob -name "Name of your backup job"
$Options = $Job.GetOptions()
$Options.GenerationPolicy.EnableCompactFull = $True
$Options.GenerationPolicy.CompactFullBackupScheduleKind = 0
$Options.GenerationPolicy.CompactFullBackupDays = "Saturday"
$Job.SetOptions($Options)


Thanks.
v.Eremin
Veeam Software
 
Posts: 13296
Liked: 974 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 3 guests