-
- Novice
- Posts: 3
- Liked: never
- Joined: Feb 13, 2014 7:31 am
- Full Name: Lehnert Rudolf
- Contact:
post job activity only when Veeam backup completed OK?
Hi!
Searched up + down in the forum but found nothing concerning my problem.
I want to run a "post job activity" (= run the following command) only if the Veeam Backup-job completed with an OK status.
Assume I have a Veeam Backup job defined an afterwards I want to copy the backed up VMs to another disk.
I'd define a "post job activity" with a robocopy, rsync, whatever.
But I'd only want to do the copyin if the Veeam job exited with "OK". I'd not want to copy anything if the Veeam job had errors.
Is there a way to check the exit status of the Veeam job from the afterwards called "post job activity" job?
Hope someone has an idea!
Fanx a lot in advance!
Bye
Searched up + down in the forum but found nothing concerning my problem.
I want to run a "post job activity" (= run the following command) only if the Veeam Backup-job completed with an OK status.
Assume I have a Veeam Backup job defined an afterwards I want to copy the backed up VMs to another disk.
I'd define a "post job activity" with a robocopy, rsync, whatever.
But I'd only want to do the copyin if the Veeam job exited with "OK". I'd not want to copy anything if the Veeam job had errors.
Is there a way to check the exit status of the Veeam job from the afterwards called "post job activity" job?
Hope someone has an idea!
Fanx a lot in advance!
Bye
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: post job activity only when Veeam backup completed OK?
You can write a script that checks job last result and proceeds to further commands only if the last job session was successful. Then, set this script as a post job activity.
Thanks.
Code: Select all
asnp VeeamPSSnapin
$Job = Get-VBRJob -name "Name of your backup"
if ($job.GetLastResult() -eq "Success")
{
Place your commands here
}
-
- Novice
- Posts: 3
- Liked: never
- Joined: Feb 13, 2014 7:31 am
- Full Name: Lehnert Rudolf
- Contact:
Re: post job activity only when Veeam backup completed OK?
Hi!
Thanks for the fast reply!
Your code doesn't look to me like a Windows "CMD" code.....
What "language" is it?
Could this be achieved with "DOS" (.cmd) code, too?
Bye
Thanks for the fast reply!
Your code doesn't look to me like a Windows "CMD" code.....
What "language" is it?
Could this be achieved with "DOS" (.cmd) code, too?
Bye
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: post job activity only when Veeam backup completed OK?
Sorry, I should have been more clearer - it's nothing but a PowerShell script that uses our PS snapin.
If you're after running executables in PowerShell, kindly, see this TechNet article; should give you some hints.
Thanks.
If you're after running executables in PowerShell, kindly, see this TechNet article; should give you some hints.
Thanks.
-
- Novice
- Posts: 3
- Liked: never
- Joined: Feb 13, 2014 7:31 am
- Full Name: Lehnert Rudolf
- Contact:
Re: post job activity only when Veeam backup completed OK?
Fanx!
I'll read this article and try to follow your hints!
Bye
I'll read this article and try to follow your hints!
Bye
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: post job activity only when Veeam backup completed OK?
You're welcome. Should any other questions arise, don't hesitate to let us know.
-
- Influencer
- Posts: 16
- Liked: 2 times
- Joined: Nov 21, 2012 4:15 pm
- Full Name: Andy Blackman
- Contact:
[MERGED] Delete files on Successful Backup
Hi
We're in the process of removing the final remnants of our legacy backup system (after a few years of using Veeam).
On our legacy backup system when a user leaves we archive their mailboxes off to a PST and the old backup system backs them up to a reference backup and deletes them on a successful backup.
So, looking to implement the same functionality, does the "Run the following script after the job" only run after a successful backup, or does it run even if the backup fails?
If it runs regardless, is there any way to run something to delete files after a successful backup?
Thanks
Andy
We're in the process of removing the final remnants of our legacy backup system (after a few years of using Veeam).
On our legacy backup system when a user leaves we archive their mailboxes off to a PST and the old backup system backs them up to a reference backup and deletes them on a successful backup.
So, looking to implement the same functionality, does the "Run the following script after the job" only run after a successful backup, or does it run even if the backup fails?
If it runs regardless, is there any way to run something to delete files after a successful backup?
Thanks
Andy
-
- Veeam Software
- Posts: 21139
- Liked: 2141 times
- Joined: Jul 11, 2011 10:22 am
- Full Name: Alexander Fogelson
- Contact:
Re: post job activity only when Veeam backup completed OK?
Andy, post-job activity command is executed regardless of the job status, however you can use PowerShell script to check the status and then execute the required action. Please see above for details.
-
- Influencer
- Posts: 16
- Liked: 2 times
- Joined: Nov 21, 2012 4:15 pm
- Full Name: Andy Blackman
- Contact:
Re: post job activity only when Veeam backup completed OK?
Excellent - thanks. I didn't find that thread when I searched.
-
- Veeam Software
- Posts: 21139
- Liked: 2141 times
- Joined: Jul 11, 2011 10:22 am
- Full Name: Alexander Fogelson
- Contact:
Re: post job activity only when Veeam backup completed OK?
Thanks for using search, anyway.
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 70 guests