FallenHoot Posted May 12, 2013 Share Posted May 12, 2013 I have been searching around Google and stackoverflow for a script that will call the HTTP website and see if it is running. If it is running keep testing every 10 minutes. If it is not running, restart the service. I want to run this on the server with Apatche Tomcat. @ echo off :first PING -n 5 google.com | FIND "TTL" > nul IF %errorlevel% == 0 ( echo Website is up. goto :first ) ELSE ( echo Website is down. Restarting service goto :second echo restart echo ping ) :: This calls the second loop :second :: This will stop the service net stop TapiSrv ping -n 10 127.0.0.1 :: This will start the service net start TapiSrv :: This check to see if the website is up GOTO :first I need to figure out how to do the 10 minutes between each loop. If it fails and restarts the service. I need it to start the loop again. Link to comment Share on other sites More sharing options...
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!Register a new account
Already have an account? Sign in here.Sign In Now