PowerShell script exchange
Post Reply
MarcinS
Enthusiast
Posts: 29
Liked: 2 times
Joined: May 18, 2015 8:31 am
Contact:

Start-VBRJob & chain

Post by MarcinS »

Hi Guys,

i have 2 jobs (1 backup and 1 replica). Replica job should go when backup job finish

- when i start backup job manually it work cause ask that there are jobs in chain and ask if replica should be started
- when i start backup job from scheduler it also work ....and replica is started after backup finish

unfortunately i found that when i start backub job by script

Get-VBRJob -Name "BckJob" | Start-VBRJob -RunAsync

it not start replica after it. Is any syntax to add for Start-VBRJob command to start also jobs in chain ?
Vitaliy S.
VP, Product Management
Posts: 27055
Liked: 2710 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Start-VBRJob & chain

Post by Vitaliy S. »

Hi MarcinS,

Can you please tell me why would you like to chain these jobs? Do you process the same VMs with them or there are some other considerations? As to chaining jobs with PowerShell, then I believe you just need to trigger them via separate cmdlets in the same script, our PS community should assist you with the script.

Thanks!
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Start-VBRJob & chain

Post by veremin »

Start-VBRJob doesn't take care about chained jobs, indeed. Thus, to execute job in required order you have to start them one by one, similar to the following:

Code: Select all

Start-VBRJob -Job $Job1
Start-VBRJob -Job $Job2
Start-VBRJob -Job $Job3
Thnaks.
sysinfma
Enthusiast
Posts: 31
Liked: 7 times
Joined: Apr 14, 2021 12:25 pm
Full Name: Chris
Contact:

Re: Start-VBRJob & chain

Post by sysinfma » 2 people like this post

I am just glad to find out that the option "-StartChainedJobs" has been introduced in the meantime!
Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests