springboot項目在linux上長久運行的shell腳本

啓動腳本start.sh

nohup java -jar system-2.4.jar --spring.profiles.active=prod &

終止腳本stop.sh

PID=$(ps -ef | grep system-2.4.jar | grep -v grep | awk '{ print $2 }')
if [ -z "$PID" ]
then
echo Application is already stopped
else
echo kill $PID
kill $PID
fi

查看日誌腳本log.sh

tail -f nohup.out

 

日誌文件tail -f nohup.out

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章