PowerShell script exchange
Post Reply
joserizal
Service Provider
Posts: 8
Liked: never
Joined: Jul 26, 2016 4:49 am
Contact:

Postpone job until previous merge completes

Post by joserizal »

Hi all,

I have an issue where a replication job schedule is quite frequent and often runs again before the merge of the previous schedule has completed, which causes us to have orphaned checkpoints all over the place. I am trying to implement a pre/post-script to check if the particular VM is currently merging and postpones the job until next schedule if it is. I toyed around with trying to disable the job in a pre-script if it is merging and re-enabling it, but since the job gets disabled and doesn't finish I can't re-enable it in the post-script. I'm wondering if there is a better way to do this than using an if? (maybe a while loop?)? Appreciate the assistance.

Code: Select all

$VM = Get-SCVirtualMachine -name VMName
$Job = Get-VBRJob Replica-Job

if ($VM.status = "Merging"){
	Disable-VBRJob $Job
	}
Regards
veremin
Product Manager
Posts: 20283
Liked: 2258 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Postpone job until previous merge completes

Post by veremin »

Having frequent schedule (even the one cannot be guaranteed by currently assigned backup resources) should not result in orphaned checkpoints. So, I'd recommend running this issue by support team and letting them confirm your environment. Thanks!
Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests