Created
March 19, 2020 21:52
-
-
Save ricdex/fd17cf22d44ce32fd31579afad319488 to your computer and use it in GitHub Desktop.
Iniciar proceso de tomcat si no existe
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
output=$(ps h -C java -o "%p:%a" | grep catalina | cut -d: -f1) | |
if [ -z $output ]; then | |
echo "$(date) - Process not found, need to start" | |
/opt/tomcat/bin/startup.sh | |
else | |
echo "$(date) - Process found, no need to start" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
crontab
*/5 * * * * /home/culqi/tomcat_autorestart.sh >> /tmp/tomcat_autorestart.log