启动脚本(一):
nohup java -jar /export/APPs/smartcourt-devicemqtt-0.0.1-SNAPSHOT.jar >/export/Logs/devicemqtt.txt &
注意:smartcourt-devicemqtt-0.0.1-SNAPSHOT.jar为示例jar包名;devicemqtt.txt为示例日志文件名
启动脚本(二):
nohup java -jar eladmin-system-2.4.jar > nohup.out 2>&1 &
注意:eladmin-system-2.4.ja为示例jar包名;nohup.out为示例日志文件名
停止脚本:
#!/bin/bash
PID=$(ps -ef | grep smartcourt-devicemqtt-0.0.1-SNAPSHOT | grep -v grep | awk '{ print $2 }')
if [ -z "$PID" ]
then
echo smartcourt-devicemqtt is already stopped
else
echo kill -9 $PID
kill -9 $PID
fi
注意:smartcourt-devicemqtt-0.0.1-SNAPSHOT.jar为示例jar包名;
原创文章,作者:kepupublish,如若转载,请注明出处:https://blog.ytso.com/277782.html