Change sync hour backup copy

PowerShell script exchange

Change sync hour backup copy

Veeam Logoby Cyril_Mars » Thu Aug 06, 2015 3:01 pm

Hi,

I create a post job script in backup job in order to launch his backup copy sync :

Code: Select all
Add-PSSnapin VeeamPSSnapin

$Job = Get-VBRJob –name "BACKUP COPY TEST"
Sync-VBRBackupCopyJob –Job $Job



This backup copy job have an interval copy of 1 day with an hour.
I need add to this script the possibility to change the hour copy interval for his next synchronization.

In fact the script must replace the hour interval job by the actual hour of system. In this case, the backup copy job will have 1 day for copying backup job and will sync the day after at the same hour.

Do you have an idea for scripting this?

Thank you
Cyril_Mars
Novice
 
Posts: 3
Liked: never
Joined: Thu Aug 06, 2015 11:36 am
Full Name: Cyril

Re: Change sync hour backup copy

Veeam Logoby PTide » Fri Aug 07, 2015 11:41 am

Hi,

There is an option to set some parameters manually.

Assume you've created a copy job named, say, "Backup Copy Job 1". The method provided below is not recommended.
Code: Select all
$bcJob = get-vbrjob -Name "Backup Copy Job 1"
$bcjob.Options.GenerationPolicy

EnableDeletedVmDataRetention            : False
DeletedVmsDataRetentionPeriodDays       : 30
RecoveryPointObjectiveValue             : 13
RecoveryPointObjectiveUnit              : Minute
SyncIntervalStartTime                   : 00:00:00
RetentionPolicyType                     : Simple
KeepGfsBackup                           : False
SimpleRetentionRestorePoints            : 7
EnableCompactFull                       : False
CompactFullBackupScheduleKind           : Monthly
CompactFullBackupDays                   : {Saturday}
CompactFullBackupMonthlyScheduleOptions : Veeam.Backup.Model.CDomFullBackupMonthlyScheduleOp
EnableRechek                            : True
RecheckScheduleKind                     : Monthly
RecheckDays                             : {Saturday}
RecheckBackupMonthlyScheduleOptions     : Veeam.Backup.Model.CDomFullBackupMonthlyScheduleOp
GFSRecentPoints                         : 7
GFSWeeklyBackups                        : 4
GFSMonthlyBackups                       : 0
GFSQuarterlyBackups                     : 0
GFSYearlyBackups                        : 0
WeeklyBackupDayOfWeek                   : Sunday
WeeklyBackupTime                        : 22:00:00
MonthlyBackup                           : Veeam.Backup.Model.CDomMonthlyBackupCreationTime
QuarterlyBackup                         : Veeam.Backup.Model.CDomQuarterlyBackupCreationTime
YearlyBackup                            : Veeam.Backup.Model.CDomYearlyBackupCreationTime


Now you need to set some values. Example:

Code: Select all
$bcJob.Options.GenerationPolicy.RecoveryPointObjectiveValue = 13
$bcJob.Options.GenerationPolicy.RecoveryPointObjectiveUnit = 0

Units: 0 for minutes, 1 for hours, 2 for days.

P.S. Nevertheless, I'd recommend you to find some workaround using task scheduler.

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

Re: Change sync hour backup copy

Veeam Logoby Cyril_Mars » Tue Aug 11, 2015 1:36 pm

Hi,

Thank you for your response. It works :)
However, why these commands are not recommanded?

When yo talk about task scheduler, it concerns scheduleOptions commands?
Thank you
Cyril_Mars
Novice
 
Posts: 3
Liked: never
Joined: Thu Aug 06, 2015 11:36 am
Full Name: Cyril

Re: Change sync hour backup copy

Veeam Logoby PTide » Tue Aug 11, 2015 2:18 pm

Hi,

why these commands are not recommanded?
Because it happens so, that people tweaking anything what is not in a reference guide may accidentally do something wrong (no offense, it happens to all of us :) ). Another reason - nobody can guarantee that in next release/build something won't change in such way that the mentioned workaround becomes unusable. With that said - be very careful using any undocumented tricks.

When yo talk about task scheduler, it concerns scheduleOptions commands?
It concerns Windows built-in Task Scheduler.

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

Re: Change sync hour backup copy

Veeam Logoby PTide » Tue Aug 11, 2015 5:54 pm

Could you please clarify what exactly are you trying to accomplish? It seems to me that there should be a simpler way of scheduling backup copy job.

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

Re: Change sync hour backup copy

Veeam Logoby Cyril_Mars » Mon Sep 21, 2015 7:49 am

Hello,

Sorry for the delay.
The problem is solved.

Thank you
Cyril_Mars
Novice
 
Posts: 3
Liked: never
Joined: Thu Aug 06, 2015 11:36 am
Full Name: Cyril


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 5 guests