[code]#!/bin/bash
test=`ps aux|grep tomcat8081|grep -v grep`
if [ -n "$test" ]
then
echo "$(date) tomcat is ok">> /home/appusr/shell/logs/autostart-acc.log
else
sh /home/appusr/tomcat8081/bin/startup.sh &>/dev/null
echo "$(date) restart tomcat ">> /home/appusr/shell/logs/autostart-err.log
fi[code]*/1 * * * * /home/appusr/shell/ar-restart.sh