shell 重启java 程序

shell 重启java 程序

#!/bin/sh
jarname='test-1.0'
pid=`ps aux | grep $jarname | grep -v grep | awk '{print $2}'`
echo $pid
kill -9 $pid
nohup java -jar $jarname.jar --spring.profiles.active=test -server -Xms512m -Xmx512m > ./run.log 2>&1 &
echo "start successed!!!"
原文地址:https://www.cnblogs.com/unknows/p/14010501.html