In my setup I have about 10 backup jobs. I would like to start a HP Data Protector job after the last job finishes. So ideally I would run a post job script which starts the HP Data Protector job. My problem is that when the last Veeam job is completed earlier jobs might still be running.
So I was searching the forum to see if I could find a PowerShell script providing this functionality. I couldn’t find one .
Marcel wrote:So I was searching the forum to see if I could find a PowerShell script providing this functionality. I couldn’t find one
That is strange, because I can see all the latest forum searches, and there are no relevant ones
There are many existing topics with sample scripts querying job status, just search for powershell job status
Also, you may want to check out this sample script for tape backup integration.
That is strange, because I can see all the latest forum searches, and there are no relevant ones
There are many existing topics with sample scripts querying job status, just search for powershell job status
I understand, this just for your reference, as this is what most people are using.
Regarding querying job status, just search the forum for powershell job status
That will cycle through all your jobs and get the latest state.
Skype: Sethbartlett88 - Make sure to label who you are and why you want to add me
Twitter: @sethbartlett
If my post was helpful, please like it. Sometimes twitter is quicker to hit me up if you need me.
Add-PSSnapin Veeampssnapin
$JobActive=0
Do {
foreach ($v in (Get-VBRJob))
{
$JobStatus = ($v.GetLastState())
If ($JobStatus -notlike "Stopped"){$JobActive ++}
}}
while($JobActive -notlike "0")
#Insert backup command here
Would be a nice feature in the next release. A little checkbox in the post job activity screen "Only run when no jobs are running" would be enough for me.
Edit: I would be realy nice to have a job chaining feature in the next release. @Veeam please see this as a feature request.
We do have "job chaining" so to speak. If you go to properties -> Next until the last page that says "Summary". You can grab the command line string and place it into the "post job" script for another job. From here, one job will kick off another.
Skype: Sethbartlett88 - Make sure to label who you are and why you want to add me
Twitter: @sethbartlett
If my post was helpful, please like it. Sometimes twitter is quicker to hit me up if you need me.
Chaining jobs together with the command in the summary tab doesn't require any powershell. If you want to make sure other jobs aren't running or special things, then that currently requires powershell:)
Skype: Sethbartlett88 - Make sure to label who you are and why you want to add me
Twitter: @sethbartlett
If my post was helpful, please like it. Sometimes twitter is quicker to hit me up if you need me.
Anton, maybe chaining isn’t the right word. Let’s call it grouping. Grouping lets us put multiple jobs in a group. One feature of a group is the ability to set a post command after all the jobs in this group are done (regardless of the result).
Another nice feature of a group would be to set (besides a post job command) some of the settings for all the jobs in the group for example VSS credentials, Restore points etc.
You might say “There is a job for, you don’t need group”. When we install Veeam at large customers (200+ vm’s) we need to create multiple jobs. In the past we created one job for a lot of VM’s. We noticed this is not always the best way to go. One reason for this is file corruption. In the past we had file corruption a few times. The only way to resolve this was to create a new full backup. This can take a long time when we are talking about more the 15TB.