Centos7下定时重启gunicorn进程的shell脚本

1.脚本内容

#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
#bin/bash
ps -ef | grep -E "run:app" | grep -v grep | awk '{print $2}' | xargs kill -9
cd /home/strategy2
gunicorn  --bind=0.0.0.0:8000 run:app&
echo $?
echo "reboot run.app is ok"
echo "----------------------------------------------------------------------------"
endDate=`date +"%Y-%m-%d %H:%M:%S"`
echo "★[$endDate] Successful"
echo "----------------------------------------------------------------------------"

2.crontab -e

10 0 * * *  /opt/cron/reboot.sh >> /opt/cron/reboot.log 2>&1
上一篇:docker搭建oracle开发环境


下一篇:跨平台 App 开发引擎 CrossApp