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

posted @ 2020-05-16 13:57  开源  阅读(784)  评论(0编辑  收藏  举报