This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
k18-ntcs-web-ntc/src/main/resources/scripts/servieDaemon.sh

23 lines
612 B
Bash
Raw Normal View History

#!/bin/bash
##tomcat安装位置
tomcatPath=/home/ceiec/webTomcat
#tomcatPath=/opt/mesasoft/tomcat
##下面的不要改了,默认即可
tomcatProcess=$tomcatPath/bin/bootstrap.jar
tomcatName=$tomcatPath
logPath=$tomcatPath/logs/daemon.log
echo $logPath
while true;do
count=`ps -ef|grep ${tomcatProcess} |grep -v grep`
if [ $? -ne 0 ]
then
echo "时间:`date '+%Y-%m-%d %T'` "$tomcatName"进程不存在,开始启动"$tomcatName >> $logPath
rm -rf $tomcatPath/work
nohup $tomcatPath/bin/startup.sh &
else
echo "时间:`date '+%Y-%m-%d %T'` "$tomcatName"进程存在" >> $logPath
fi
sleep 60
done