1. 程式人生 > >tomcat重啟、關閉、檢視日誌shell

tomcat重啟、關閉、檢視日誌shell

restart

#!/bin/sh
pid=`ps -ef | grep apache-tomcat-6.0.41| grep -v grep | grep -v retomcat | awk '{print $2}'`
echo $pid
if [ -n "$pid" ];
then
#echo ========kill tomcat begin==============
#echo $pid
kill -9 $pid
#echo ========kill tomcat end==============
#sleep 5
#echo ===========startup.sh==============
#/etc/init.d/tomcat6 restart
sh /opt/apache-tomcat-6.0.41/bin/startup.sh
else
#echo ===========startup.sh==============
#/etc/init.d/tomcat6 restart
sh /opt/apache-tomcat-6.0.41/bin/startup.sh
fi

kill
#!/bin/sh
pid=`ps -ef | grep apache-tomcat-6.0.41-BDMPProxy | grep -v grep | grep -v retomcat | awk '{print $2}'`
if [ -n "$pid" ]
then
{
echo ========kill tomcat begin==============
echo $pid
kill -9 $pid
echo ========kill tomcat end==============
}
fi

log
 tail -f /opt/apache-tomcat-6.0.41/logs/catalina.out;