SetScheduleDependentJobs VEEAM 7.0

PowerShell script exchange

SetScheduleDependentJobs VEEAM 7.0

Veeam Logoby ArnaudK » Thu Sep 05, 2013 2:20 pm

Hi!

I Just have little problem for scripting jobs:
$Job1 = Get-VBRJob -name $JobName
$Job2 = Get-VBRJob -name $SecondJobName
$Job2.SetScheduleDependentJobs($Job1)


Result : Job1 After Job1!

And $Job1.SetScheduleDependentJobs($Job2)

Result : Job2 After Job2!

Any help please?
ArnaudK
Novice
 
Posts: 5
Liked: never
Joined: Thu Sep 05, 2013 10:16 am
Full Name: Arnaud K

Re: SetScheduleDependentJobs VEEAM 7.0

Veeam Logoby v.Eremin » Thu Sep 05, 2013 2:45 pm

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.
v.Eremin
Veeam Software
 
Posts: 13296
Liked: 974 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: SetScheduleDependentJobs VEEAM 7.0

Veeam Logoby ArnaudK » Thu Sep 05, 2013 3:55 pm

Thank you for the answer, but I dont think so:

Image
ArnaudK
Novice
 
Posts: 5
Liked: never
Joined: Thu Sep 05, 2013 10:16 am
Full Name: Arnaud K

Re: SetScheduleDependentJobs VEEAM 7.0

Veeam Logoby ArnaudK » Fri Sep 06, 2013 8:00 am

Mmh, it's worst that i was thinking, my backup was launched at 22:00 !!!

Edit TEST Job:

Image

He display the first Job in my list and ask me to choose one if i want to click OK.
ArnaudK
Novice
 
Posts: 5
Liked: never
Joined: Thu Sep 05, 2013 10:16 am
Full Name: Arnaud K

Re: SetScheduleDependentJobs VEEAM 7.0

Veeam Logoby v.Eremin » Fri Sep 06, 2013 10:44 am

It seems to be a bug, indeed. Though, the following script appears to work, as expected:

Code: Select all
Asnp VeeamPSSnapin
$Job1 = Get-VBRJob -name "Name of first job"
$Job2 = Get-VBRJob -name "Name of second job"
$Job2.SetScheduleDependentJobs($Job1)
Set-VBRJobSchedule -Job $Job1 -AfterJob $Job2

Hope this helps.
Thanks.
v.Eremin
Veeam Software
 
Posts: 13296
Liked: 974 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: SetScheduleDependentJobs VEEAM 7.0

Veeam Logoby ArnaudK » Fri Sep 06, 2013 1:23 pm

Thanks!!!

Works perferctly!
ArnaudK
Novice
 
Posts: 5
Liked: never
Joined: Thu Sep 05, 2013 10:16 am
Full Name: Arnaud K

Re: SetScheduleDependentJobs VEEAM 7.0

Veeam Logoby v.Eremin » Fri Sep 06, 2013 1:23 pm

You’re welcome. Feel free to contact us, should any other questions arise. Thanks.
v.Eremin
Veeam Software
 
Posts: 13296
Liked: 974 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: SetScheduleDependentJobs VEEAM 7.0

Veeam Logoby Tobias_Elfstrom » Mon Sep 09, 2013 3:47 pm

v.Eremin wrote:It seems to be a bug, indeed. Though, the following script appears to work, as expected:

Code: Select all
Asnp VeeamPSSnapin
$Job1 = Get-VBRJob -name "Name of first job"
$Job2 = Get-VBRJob -name "Name of second job"
$Job2.SetScheduleDependentJobs($Job1)
Set-VBRJobSchedule -Job $Job1 -AfterJob $Job2

Hope this helps.
Thanks.


In this example is $Job2 supposed to run after $Job1 ?
I can't seem to get this right...

I do this:
Code: Select all
$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:
Image
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....
Tobias_Elfstrom
Enthusiast
 
Posts: 84
Liked: 8 times
Joined: Wed Jul 04, 2012 6:32 am
Full Name: Tobias Elfstrom

Re: SetScheduleDependentJobs VEEAM 7.0

Veeam Logoby v.Eremin » Mon Sep 09, 2013 4:03 pm

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.
v.Eremin
Veeam Software
 
Posts: 13296
Liked: 974 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: SetScheduleDependentJobs VEEAM 7.0

Veeam Logoby Tobias_Elfstrom » Tue Sep 10, 2013 2:34 pm

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
Tobias_Elfstrom
Enthusiast
 
Posts: 84
Liked: 8 times
Joined: Wed Jul 04, 2012 6:32 am
Full Name: Tobias Elfstrom

Re: SetScheduleDependentJobs VEEAM 7.0

Veeam Logoby v.Eremin » Tue Sep 10, 2013 2:39 pm

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.
v.Eremin
Veeam Software
 
Posts: 13296
Liked: 974 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: SetScheduleDependentJobs VEEAM 7.0

Veeam Logoby Tobias_Elfstrom » Mon Oct 07, 2013 11:59 am

Any of these fixed in patch01?
http://www.veeam.com/kb_articles.html/kb1823 says nothing about this.
Tobias_Elfstrom
Enthusiast
 
Posts: 84
Liked: 8 times
Joined: Wed Jul 04, 2012 6:32 am
Full Name: Tobias Elfstrom

Re: SetScheduleDependentJobs VEEAM 7.0

Veeam Logoby v.Eremin » Mon Oct 07, 2013 1:41 pm

Nope, the issue with backup to tape job and .ScheduleDependentJob() hasn’t been resolved in the Patch#1. Thanks.
v.Eremin
Veeam Software
 
Posts: 13296
Liked: 974 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: SetScheduleDependentJobs VEEAM 7.0

Veeam Logoby v.Eremin » Mon Oct 07, 2013 2:21 pm

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:

Code: Select all
asnp VeeamPssnapin
$Job = Get-VBRJob -name "Name of first backup job"
$Job2 = Get-VBRJob -name "Name of second backup job”
$ScheduleOptions = $Job.GetScheduleOptions()
$ScheduleOptions.OptionsScheduleAfterJob.IsEnabled = $True
$Job.options.JobOptions.RunManually = $False
Set-VBRJobScheduleOptions -Job $Job -Options $ScheduleOptions
Set-VBRJobSchedule -Job $Job -AfterJob $Job2


Thanks.
v.Eremin
Veeam Software
 
Posts: 13296
Liked: 974 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 6 guests