-
- Influencer
- Posts: 12
- Liked: never
- Joined: Sep 05, 2014 6:24 am
- Contact:
Creating a backup job through powershell starts job directly
Hi,
I created a simple script to create a backup job. When this gets created it directly starts the backup job.
I don't want this to happen, I want it to follow the schedule I submitted with the Job. Any tips?
Add-VBRViBackupJob -Name "$SERVERNAAM" -BackupRepository "Default Backup Repository" -Entity (Find-VBRViEntity -Server "192.168.20.75" -VMsAndTemplates -Name "$SERVERNAAM")
$Job = Get-VBRJob -Name "$SERVERNAAM"
$JobOptions = Get-VBRJobOptions $Job
$JobOptions.BackupTargetOptions.TransformFullToSyntethic = $false
$JobOptions.BackupStorageOptions.EnableFullBackup = $true
$JobOptions.BackupStorageOptions.RetainCycles = $SNAPSHOTS
Set-VBRJobOptions $Job -Options $JobOptions
$ScheduleOptions = Get-VBRJobScheduleOptions $Job
$ScheduleOptions.OptionsDaily.Enabled = $true
$ScheduleOptions.OptionsDaily.Kind = "Weekdays"
$ScheduleOptions.OptionsDaily.Time = "22:00:00"
Set-VBRJobScheduleOptions -Job ($Job) -Options ($ScheduleOptions)
Enable-VBRJobSchedule -Job ($Job)
I created a simple script to create a backup job. When this gets created it directly starts the backup job.
I don't want this to happen, I want it to follow the schedule I submitted with the Job. Any tips?
Add-VBRViBackupJob -Name "$SERVERNAAM" -BackupRepository "Default Backup Repository" -Entity (Find-VBRViEntity -Server "192.168.20.75" -VMsAndTemplates -Name "$SERVERNAAM")
$Job = Get-VBRJob -Name "$SERVERNAAM"
$JobOptions = Get-VBRJobOptions $Job
$JobOptions.BackupTargetOptions.TransformFullToSyntethic = $false
$JobOptions.BackupStorageOptions.EnableFullBackup = $true
$JobOptions.BackupStorageOptions.RetainCycles = $SNAPSHOTS
Set-VBRJobOptions $Job -Options $JobOptions
$ScheduleOptions = Get-VBRJobScheduleOptions $Job
$ScheduleOptions.OptionsDaily.Enabled = $true
$ScheduleOptions.OptionsDaily.Kind = "Weekdays"
$ScheduleOptions.OptionsDaily.Time = "22:00:00"
Set-VBRJobScheduleOptions -Job ($Job) -Options ($ScheduleOptions)
Enable-VBRJobSchedule -Job ($Job)
-
- Product Manager
- Posts: 20413
- Liked: 2301 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Creating a backup job through powershell starts job dire
Can you tell me what time you can see if go to the job schedule settings right after the job has been created? Thanks.
-
- Influencer
- Posts: 12
- Liked: never
- Joined: Sep 05, 2014 6:24 am
- Contact:
Re: Creating a backup job through powershell starts job dire
It shows on the main page:
<Scheduled>
after a few seconds this changes to: Next run, current time + 5 minutes.
When opening the job it shows the correct schedule.
<Scheduled>
after a few seconds this changes to: Next run, current time + 5 minutes.
When opening the job it shows the correct schedule.
-
- Product Manager
- Posts: 20413
- Liked: 2301 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Creating a backup job through powershell starts job dire
Hmm, what happens if you try to use slightly different syntax? Will it make any difference?
I also assume you're on the latest product version, right?
Thanks.
Code: Select all
$ScheduleOptions = $Job.GetScheduleOptions()
$ScheduleOptions.OptionsContinuous.Enabled = $false
$ScheduleOptions.OptionsMonthly.Enabled = $false
$ScheduleOptions.OptionsPeriodically.Enabled = $false
$ScheduleOptions.OptionsScheduleAfterJob.IsEnabled = $false
$ScheduleOptions.OptionsDaily.Enabled = $true
$ScheduleOptions.OptionsDaily.Kind = "Weekdays"
$ScheduleOptions.OptionsDaily.Time = "13:00:00"
Set-VBRJobScheduleOptions -Job ($Job) -Options ($ScheduleOptions)
Thanks.
-
- Influencer
- Posts: 12
- Liked: never
- Joined: Sep 05, 2014 6:24 am
- Contact:
Re: Creating a backup job through powershell starts job dire
Same occurs. It adds the backup job and the next run is first set on <Scheduled>.
After a few seconds it changes to the current time + 5 minutes as next run time, while the schedule is for 22:00:00
Running on latest version, 7.0.0.871
After a few seconds it changes to the current time + 5 minutes as next run time, while the schedule is for 22:00:00
Running on latest version, 7.0.0.871
-
- Product Manager
- Posts: 20413
- Liked: 2301 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Creating a backup job through powershell starts job dire
We have number of issues related to schedule configuration working improperly in case of PS. So, this must be another instance of those. We're going to review it thoroughly and try to make sure that previous issues won't leak into the next product version. Thanks.
Who is online
Users browsing this forum: No registered users and 10 guests