-
- Lurker
- Posts: 1
- Liked: never
- Joined: Nov 09, 2012 7:04 am
- Full Name: Howard Lee
- Contact:
VBR6.5 - Schedule "After this job"
Hi,
You may see there is a new feature about chain execution of jobs in version 6.5. Is there a syntax or command that can modify the option field using powershell?
Thanks.
You may see there is a new feature about chain execution of jobs in version 6.5. Is there a syntax or command that can modify the option field using powershell?
Thanks.
-
- VP, Product Management
- Posts: 27377
- Liked: 2802 times
- Joined: Mar 30, 2009 9:13 am
- Full Name: Vitaliy Safarov
- Contact:
Re: VBR6.5 - Schedule "After this job"
Hi Howard,
Unfortunately, there is no such command in PowerShell. However, you may want to use the following cmdlet to check current job status and based on the returned result trigger the subsequent backup jobs.
Thanks!
Unfortunately, there is no such command in PowerShell. However, you may want to use the following cmdlet to check current job status and based on the returned result trigger the subsequent backup jobs.
Thanks!
-
- Product Manager
- Posts: 20415
- Liked: 2305 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: VBR6.5 - Schedule "After this job"
Although, what Vitaliy said was absolutely true, I can propose you some kind of workaround which is able to bypass existing VB&R PowerShell limitations.
What I’m going to represent is:
1)Creation of .bat-file, which consists of PowerShell-commands and which is responsible for starting second, third, whatever number of job in the chain.
2)Specifying this file as a target for Job’s post activity.
I'll show you PowerShell script regarding case of chain execution of only two jobs. However, by the means of simply modifications you can reach whatever scale you want.
First of all, you have to decide where you’re going to store you .bat –file. Say, it’d be D:\Test.bat.
With this knowledge modify Post-activity settings of your first job:
Then write simple PowerShell-script responsible for execution second job in chain:
Translate it to .bat appropriate format. So, you .bat file should look like this:
That’s all.
Hope this helps.
Thanks.
What I’m going to represent is:
1)Creation of .bat-file, which consists of PowerShell-commands and which is responsible for starting second, third, whatever number of job in the chain.
2)Specifying this file as a target for Job’s post activity.
I'll show you PowerShell script regarding case of chain execution of only two jobs. However, by the means of simply modifications you can reach whatever scale you want.
First of all, you have to decide where you’re going to store you .bat –file. Say, it’d be D:\Test.bat.
With this knowledge modify Post-activity settings of your first job:
Code: Select all
asnp VeeamPSSnapin
$Job = Get-VBRJob | ?{$_.Name –eq “Name of the first job”}
$jo = $job.GetOptions()
$jo.PostJobCommand.Enabled = $True
$jo.PostJobCommand.Commandline = "D:\Test.bat"
$job.SetOptions($jo)
Code: Select all
asnp VeeamPSSnapin;
$job = Get-VbrJob -name "Name of the second job";
Start-VbrJob -job $job;
Code: Select all
powershell -Command "& {asnp VeeamPSSnapin;$job = Get-VbrJob -name "Name of the second job";Start-VbrJob -job $job;}"
Hope this helps.
Thanks.
-
- Product Manager
- Posts: 20415
- Liked: 2305 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: VBR6.5 - Schedule "After this job"
Just want to update the community with the latest information regarding linking jobs through the PowerShell. We’ve fixed previously existing bug with “SetScheduleDependentJobs” method. So, if you’re willing to set a dependent job kindly use the following script:
As the result, backup job 2 will be scheduled after Backup Job 1.
Hope this helps.
Thanks.
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.
-
- Lurker
- Posts: 1
- Liked: never
- Joined: Aug 12, 2014 7:33 am
- Contact:
Re: VBR6.5 - Schedule "After this job"
Hi
Is the cmdlet SetVbrJobSchedule available in Veeam 6.5.0.109 x64 ?
Because I have an error : cmdlet SetVbrJobSchedule not recognized.
I have already added the snappin Veeam and other cmdlet work properly...
Thanks
Is the cmdlet SetVbrJobSchedule available in Veeam 6.5.0.109 x64 ?
Because I have an error : cmdlet SetVbrJobSchedule not recognized.
I have already added the snappin Veeam and other cmdlet work properly...
Thanks
-
- Product Manager
- Posts: 20415
- Liked: 2305 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: VBR6.5 - Schedule "After this job"
If my memory serves me well, back at v6.5 days, it was impossible to set dependent job, using PS snap-in, and the only workaround was to use .bat-command. Anyway, you can open a VB&R PS snap-in (Menu -> PowerShell), type Get-VBRCommand and see whether or not the said commandlet is present. Thanks.
-
- Veeam Software
- Posts: 649
- Liked: 170 times
- Joined: Dec 10, 2012 8:44 am
- Full Name: Nikita Efes
- Contact:
Re: VBR6.5 - Schedule "After this job"
Set-VBRJobSchedule was introduced in 7.0
There were Set-VBRJobScheduleOptions in 6.5
You can also check this page to the list of available cmdlets: http://helpcenter.veeam.com/backup/70/powershell/
All cmdlets have an information, were they appear in 7.0 or came from previous versions.
There were Set-VBRJobScheduleOptions in 6.5
You can also check this page to the list of available cmdlets: http://helpcenter.veeam.com/backup/70/powershell/
All cmdlets have an information, were they appear in 7.0 or came from previous versions.
Who is online
Users browsing this forum: No registered users and 19 guests