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