restar-astro-all.sh


  • restart-backend-astro.sh
#!/bin/sh

###stop
PID=`ps -ef | grep "/opt/astro/main.py" | grep -v "grep" |awk '{print $2}'`
for pid in $PID
do
  kill -9 $pid
done
echo "astro 后端停止完毕!"

###start
nohup /usr/bin/python3 /opt/astro/main.py > /dev/null 2>&1 &
  • restart-front-astro.sh
#!/bin/sh
now=`date +"%Y-%m-%d %H:%M:%S"`
export PATH="/root/bin:/root/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/local/python3/bin:/opt/node-v14.18.2/bin:/usr/local/go/bin:/root/go/bin:/root/bin"

ps -ef|grep -v grep |grep vue-cli-service |awk '{print $2}' | xargs kill -9

nohup /usr/local/bin/npm -prefix /opt/astro/front/ run prod > /dev/null 2>&1 &

sleep 20s
echo "${DATE_Y} 前端服务启动完毕!?(?????)?  "