1、启动脚本start.shhtml
#!/bin/shisExist=`ps -ef | grep MonitorAndImprove | grep -v grep | awk '{print $2}'`if [ ! -z "$isExist" ]; then echo "process already running!!! pid is "$isExist exit -1fiPRGDIR=`dirname "$0"` BASEDIR=`cd "$PRGDIR" ; pwd` CLASSPATH=$BASEDIR/config:$BASEDIR/lib/*nohup java -Xmx2g -Xms2g -classpath "$CLASSPATH" \ com.tencent.apd.MonitorAndImprove \ > log/out.log 2>& 1 & echo $! > progressId.pid
2、中止脚本stop.shjava
#!/bin/shif [ -f "progressId.pid" ] ; then kill -9 `cat progressId.pid` rm progressId.pidfiisExist=`ps -ef | grep MonitorAndImprove | grep -v grep | awk '{print $2}'`if [ ! -z "$isExist" ]; then kill -9 $isExistfi
3、重启脚本restart.shide
#!/bin/shsh stop.shsh start.sh
————————————————
版权声明:本文为CSDN博主「cxy1991xm」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处连接及本声明。
原文连接:https://blog.csdn.net/cxy1991xm/article/details/90447631spa