
I am looking to piece together a script where:
Backup job at Site A starts
executes a script that will check a replication job at Site B to ensure it is not currently running.
It will then keep the backup job at Site A from executing until the replication job has finished.
I understand this will require some sort of invoke command
Invoke-Command -comp RepositoryFQDN -scriptblock {ScriptBlock} , as well as some sort of do while or do until loop that continues to check the status
( $Job = Get-VBRJob -name "Name of replication Job"
$Job.GetLastState() -eq "Working" ) of the remote job say every 60 minutes and once it sees the status as not working, then will allow the current job to proceed.
This will allow me to avoid the situation where a replication job may run several hours past the expected time. This only really occurs though on our 2 file servers that have Windows 2012 enabled which will, in turn, kick off a larger than normal incremental replication job occasionally based no the Windows 2012 deduplication/garbage collection/scrubbing process.
Thanks!