抄袭咯

jarPackage="包名.jar"
str=`ps -ef | grep ${jarPackage} | grep -v "grep"|awk '{print $2}'`
kill -9 ${str}
if [ "$?" -eq 0 ]; then
    echo "killed pid is "${str}
    echo "kill success"
else
    echo "kill failed"
fi
 
nowDate=`date +"%Y-%m-%d"`

nohup java -jar -Xmn256M -Xms256M -Xmx3096M -Xss256K -XX:MaxPermSize=3096M ${jarPackage} --spring.config.location=application.properties  >./log/info.log &

nowstr=`ps -ef | grep ${jarPackage} | grep -v "grep"|awk '{print $2}'`
#打印出现在新的进程号
echo "now pid is "${nowstr}
echo "************ ok! Start Success... **************"

sleep 5
tail -f ./log/info.log

你可能感兴趣的:(抄袭咯)