#!/bin/bash
NAME="xxxx.jar"
echo "killing all by xxxx.jar"
echo $NAME
ID=`ps -ef | grep "$NAME" | grep -v "$0" | grep -v "grep" | awk '{print $2}'`
echo $ID
for id in $ID
do
kill -9 $id
echo "killed $id"
done
echo "start erp process....."
nohup java -jar xxxx.jar --spring.profiles.active=prod --server.port=8080 2>&1 | cronolog logs/nohup/nohupLog.%Y-%m-%d.out >> /dev/null &
echo "start erp success!"
sleep 1
Linux:脚本启动java后端
于 2023-06-18 21:45:13 首次发布