Veeam Backup v4 wait command

PowerShell script exchange

Re: Veeam Backup v4 wait command

Veeam Logoby Burnwell » Sat Nov 14, 2009 8:31 am

Thanks Gostev for the information.
With your help we help we now have some basic PS scripts that runs the backups one at a time. Works perfect.
Would still be nice to do a check at the end and retry failed jobs, but I too have no Powershell experience, and no idea how to script such a thing...

Regards
JJ
Burnwell
Influencer
 
Posts: 10
Liked: never
Joined: Sat Nov 07, 2009 5:30 pm
Full Name: J J

Re: Veeam Backup v4 wait command

Veeam Logoby CTCarp » Wed Oct 26, 2011 6:38 pm

I have B&R standard v5.2 - Im not sure if I understand but do I put the code "Start-VBRJob Job1" ("job1" being the name of the job) in the post script line? and for the next backup put "Start-VBRJob Job2" and so on down the list? I have 13 servers that I want to fire off sequentially
CTCarp
Influencer
 
Posts: 21
Liked: never
Joined: Thu Oct 13, 2011 11:46 am

Re: Veeam Backup v4 wait command

Veeam Logoby Vitaliy S. » Wed Oct 26, 2011 9:25 pm

Not really, powershell cmdlets will not be recognized by post backup job script line. You need to wrap it into a batch file first, then trigger this file from the job.

If you want to daisy chain backup jobs then look through this topic for more details.
Vitaliy S.
Veeam Software
 
Posts: 19541
Liked: 1098 times
Joined: Mon Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov

Re: Veeam Backup v4 wait command

Veeam Logoby CTCarp » Fri Oct 28, 2011 1:21 pm

So I would create a batch file for each individual backup then run the batch in post script ? Sorry I dont know PS at all and I am trying to figure this out.
CTCarp
Influencer
 
Posts: 21
Liked: never
Joined: Thu Oct 13, 2011 11:46 am

Re: Veeam Backup v4 wait command

Veeam Logoby Vitaliy S. » Fri Oct 28, 2011 3:51 pm

Not exactly. If a first job fails, then your post backup job script will never be triggered, meaning that your PowerShell script will not be triggered either. What I am suggesting is to use a PowerShell script to start your jobs. See example below.

Long version:
Code: Select all
$job = Get-VBRJob | where {$_.Name –eq “JobName1”}
Start-VBRJob –Job ($job)

Short version:
Code: Select all
Get-VBRJob | where {$_.Name –eq “JobName1”} | Start-VBRJob

Also you would need to verify previous job result in your script using the following PowerShell command, and then implement the desired script behavior based on the returned status, in your case it should be start of a subsequent backup job.

Code: Select all
(Get-VBRJob JobName).GetStatus()

Hope this helps!
Vitaliy S.
Veeam Software
 
Posts: 19541
Liked: 1098 times
Joined: Mon Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov

Re: Veeam Backup v4 wait command

Veeam Logoby CTCarp » Fri Oct 28, 2011 5:31 pm

its a start thank you. I dont know PS that well, so excuse my ill formed questions, but do I create the script in a batch then run it via task scheduler? I mean how is this done besides manually running the scripts.
CTCarp
Influencer
 
Posts: 21
Liked: never
Joined: Thu Oct 13, 2011 11:46 am

Re: Veeam Backup v4 wait command

Veeam Logoby Vitaliy S. » Fri Oct 28, 2011 6:30 pm

Yes, you can do it either with Task Scheduler or start it manually.
Vitaliy S.
Veeam Software
 
Posts: 19541
Liked: 1098 times
Joined: Mon Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov

Previous

Return to PowerShell



Who is online

Users browsing this forum: No registered users and 6 guests