I have one file name hello.sh. I'm running that file at every 30 mins from crontab.
In hello.sh, I have script for checking the service whether it is running or not. if its not running then it will send a mail and restart the service.
hello.sh Script:
b=$JAVA_HOME/bin/jps| grep "Bootstrap" | awk '{print $2}' if [ "$b" = "LISTEN" ]; then echo "Bootstrap is running" elif [ "$b" == "" ]; then mail -s "Message from 33 Server, The service is not running its going to restart the server " ram@gmail.com sudo catalina.sh run
It is running perfectly. Now, I am running this program every 30 mins once. If the service is not running then it will try to restart the service. Now, I need to check this script 3 times if it is not restarted the service after 1:30hrs then, I need to skip the checking process and send a mail like " This service is not running so, Need to start manually". utill service start manually it should not run the script. After starting the service manually it need to check the service from crontab every half an hour once.
If its possible how to do?