Hi, Arnaud. Seems like a GUI glitch or something; since if after running the said script you go to the schedule settings of a given job (Job2), the correct information will be shown (Job2 after Job1). Thanks.
$job = Get-VBRJob -Name $vmjobname
$tapejob = Get-VBRTapeJob -Name $tapejobname
# And set the schedule
$job.SetScheduleDependentJobs($tapejob)
Get-VBRTapeJob -Name $tapejobname |Set-VBRJobSchedule -After -AfterJob $job
Set-VBRJobSchedule -Job $tapejob -After -AfterJob $job
and I end up with this:
Note that the "Next run" seems to be correct but it doesn't work and when you bring up the job it says Daily at 22:00
The use of two Set-VBRJobSchedule is just a try from my side that maybe setting it a second time would fix it....
In this example is $Job2 supposed to run after $Job1 ?
Actually, in the example provided above job1 should be run after job2. Though, the said script doesn’t seem to work in case of backup to tape jobs, only in case of normal backup ones. Thanks.
Ok. And just to be clear, it is a bug that you cant set the schedule of a tape-job with Set-VBRJobSchedule or should you use some other method?
BR Tobias
It appears to be a bug, indeed. As well as, the situation when you have to use two different methods (SetScheduleDependentJobs, Set-VBRJobSchedule) in order to set job schedule dependency. So, I will pass this information to development team later. Thanks.
Though, in case of chaining common backup jobs, you don’t have to use two different commandlets, as has been suggested previously, since everything can be specified via Set-VBRJobScheduleOptions: