PowerShell script exchange
Post Reply
Yamy
Novice
Posts: 6
Liked: never
Joined: Dec 08, 2009 4:38 pm
Full Name: Dean White
Contact:

Post Script in Backup

Post by Yamy »

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?

Gostev
SVP, Product Management
Posts: 26679
Liked: 4268 times
Joined: Jan 01, 2006 1:01 am
Location: Baar, Switzerland
Contact:

Re: Post Script in Backup

Post by Gostev »

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()

Yamy
Novice
Posts: 6
Liked: never
Joined: Dec 08, 2009 4:38 pm
Full Name: Dean White
Contact:

Re: Post Script in Backup

Post by Yamy »

Is there a way to get a pre script to run as well?

Gostev
SVP, Product Management
Posts: 26679
Liked: 4268 times
Joined: Jan 01, 2006 1:01 am
Location: Baar, Switzerland
Contact:

Re: Post Script in Backup

Post by Gostev »

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.

Yamy
Novice
Posts: 6
Liked: never
Joined: Dec 08, 2009 4:38 pm
Full Name: Dean White
Contact:

Re: Post Script in Backup

Post by Yamy »

Thanks for the quick turn around

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests