启动和关闭jar包

Linux下后台启动springBoot项目jar包

echo -e '\n1.停止jar包' 
PID=$(ps -ef | grep ydcs-data-export-1.0.0.jar | grep -v grep | awk '{ print $2 }')
if [ -z "$PID" ]
then
  echo smartcourt-devicemqtt is already stopped
else
  echo kill -9 $PID
  kill -9 $PID
fi 

echo -e '\n2.移动文件强制覆盖'
mv -f /tmp/ydcs-data-export-1.0.0.jar /u02/webapps/exportData 

echo -e '\n3.启动jar包'
nohup java -jar ydcs-data-export-1.0.0.jar --spring.profiles.active=uat >temp.log & 

echo -e '\n完事了...'

你可能感兴趣的:(启动和关闭jar包)