Ok, I’ve got you point. In general, there are two quite similar scripts.
This one will specify the so-called "allowed" backup window. If a job exceeds allocated period, it will be terminated. This script should be used if one of the following options is ticked: Run the job automatically daily at this time, monthly at this time.
The following example has a time interval between 0 and 4 am, Sunday, as a backup window:
Code: Select all
asnp VeeamPSSnapin
$Job = Get-VBRJob -name "Name of your Job"
$ScheduleOptions = $Job.GetScheduleOptions()
$ScheduleOptions.OptionsBackupWindow.Isenabled = $True
$ScheduleOptions.OptionsBackupWindow.BackupWindow = "<scheduler><Sunday>1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</Sunday><Monday>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</Monday><Tuesday>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</Tuesday><Wednesday>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</Wednesday><Thursday>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</Thursday><Friday>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</Friday><Saturday>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</Saturday></scheduler>"
Set-VBRJobScheduleOptions -job $Job -Options $ScheduleOptions
The other one will set a window during whcih execution of a given job will be prohibited (22 00 – 05 00, all days). It should be used if "Run the job automatically periodically" option is enabled:
Code: Select all
asnp VeeamPSSnapin
$Job = Get-VBRJob -name "Name of your job"
$ScheduleOptions = $Job.GetScheduleOptions()
$ScheduleOptions.OptionsPeriodically.schedule = "<scheduler><Sunday>1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1</Sunday><Monday>1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1</Monday><Tuesday>1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1</Tuesday><Wednesday>1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1</Wednesday><Thursday>1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1</Thursday><Friday>1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1</Friday><Saturday>1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1</Saturday></scheduler>"
Set-VBRJobScheduleOptions -job $Job -Options $ScheduleOptions
Hope this helps.
Thanks.