Post Script in Backup

PowerShell script exchange

Post Script in Backup

Veeam Logoby Yamy » Tue Feb 02, 2010 12:03 pm

When I create a backup job that is set to run a Post Script will it always run the Post Script at the end of the job or can I set it so it only runs when it is successful?
Yamy
Novice
 
Posts: 6
Liked: never
Joined: Tue Dec 08, 2009 4:38 pm
Full Name: Dean White

Re: Post Script in Backup

Veeam Logoby Gostev » Tue Feb 02, 2010 12:08 pm

Dean, the Post Script will always run, however you can easily check the job result in your script using the following PowerShell command, and then implement the desired script behavior based on the returned status.
Code: Select all
(Get-VBRJob JobName).GetStatus()
Gostev
Veeam Software
 
Posts: 21396
Liked: 2350 times
Joined: Sun Jan 01, 2006 1:01 am
Location: Baar, Switzerland

Re: Post Script in Backup

Veeam Logoby Yamy » Tue Feb 02, 2010 12:42 pm

Is there a way to get a pre script to run as well?
Yamy
Novice
 
Posts: 6
Liked: never
Joined: Tue Dec 08, 2009 4:38 pm
Full Name: Dean White

Re: Post Script in Backup

Veeam Logoby Gostev » Tue Feb 02, 2010 12:44 pm

No, there is no option for pre script right now. What you can do is run the job from that script though, and schedule script (with Windows scheduler) instead of scheduling actual job.
Gostev
Veeam Software
 
Posts: 21396
Liked: 2350 times
Joined: Sun Jan 01, 2006 1:01 am
Location: Baar, Switzerland

Re: Post Script in Backup

Veeam Logoby Yamy » Tue Feb 02, 2010 12:47 pm

Thanks for the quick turn around
Yamy
Novice
 
Posts: 6
Liked: never
Joined: Tue Dec 08, 2009 4:38 pm
Full Name: Dean White


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 5 guests