PowerShell script exchange
Post Reply
sidavid
Enthusiast
Posts: 48
Liked: 1 time
Joined: Jan 01, 2006 1:01 am
Contact:

Veeam 7 set Compact Full Backup File Option

Post by sidavid »

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
veremin
Product Manager
Posts: 20400
Liked: 2298 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Veeam 7 set Compact Full Backup File Option

Post by veremin »

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.
sidavid
Enthusiast
Posts: 48
Liked: 1 time
Joined: Jan 01, 2006 1:01 am
Contact:

Re: Veeam 7 set Compact Full Backup File Option

Post by sidavid »

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
veremin
Product Manager
Posts: 20400
Liked: 2298 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Veeam 7 set Compact Full Backup File Option

Post by veremin »

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.
sidavid
Enthusiast
Posts: 48
Liked: 1 time
Joined: Jan 01, 2006 1:01 am
Contact:

Re: Veeam 7 set Compact Full Backup File Option

Post by sidavid »

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
veremin
Product Manager
Posts: 20400
Liked: 2298 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Veeam 7 set Compact Full Backup File Option

Post by veremin »

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.
Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests