script to check if repository is on line before running

PowerShell script exchange

script to check if repository is on line before running

Veeam Logoby CharadeUR » Thu Jul 19, 2012 1:38 pm

I want to create two jobs to run every Saturday but each job would only run if their respective repository is online. I would need the job to check for the repository then not run the backup if the repository was not found. Thanks.
CharadeUR
Influencer
 
Posts: 21
Liked: never
Joined: Mon Mar 05, 2012 2:29 pm
Full Name: George Streeter

Re: script to check if repository is on line before running

Veeam Logoby Sethbartlett » Thu Jul 19, 2012 1:51 pm 1 person likes this post

You would not be able to use our job scheduler. You would need to use windows task scheduler or something outside of Veeam to do this, but the script would not be too hard to write.
Skype: Sethbartlett88 - Make sure to label who you are and why you want to add me ;)
Twitter: @sethbartlett
If my post was helpful, please like it. Sometimes twitter is quicker to hit me up if you need me.
Sethbartlett
Expert
 
Posts: 282
Liked: 25 times
Joined: Wed Nov 10, 2010 6:51 pm
Full Name: Seth Bartlett

Re: script to check if repository is on line before running

Veeam Logoby CharadeUR » Thu Jul 19, 2012 2:36 pm

Thanks for that. I did write a little batch file that looks like it will work.

Code: Select all
ping 192.168.2.235
if errorlevel 1 goto END
"C:\Program Files\Veeam\Backup and Replication\Veeam.Backup.Manager.exe" backup 6de05213-6194-429b-a9eb-ae05ecbc491e
:END


My only question at this point is if I don't use the Veeam scheduler does it still retry failed VMs 3 times?
CharadeUR
Influencer
 
Posts: 21
Liked: never
Joined: Mon Mar 05, 2012 2:29 pm
Full Name: George Streeter

Re: script to check if repository is on line before running

Veeam Logoby foggy » Fri Jul 20, 2012 9:20 am

CharadeUR wrote:My only question at this point is if I don't use the Veeam scheduler does it still retry failed VMs 3 times?

Yes, I believe you can even alter the number of retries using PowerShell.
foggy
Veeam Software
 
Posts: 14742
Liked: 1080 times
Joined: Mon Jul 11, 2011 10:22 am
Full Name: Alexander Fogelson


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 5 guests