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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM