版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_36607076/article/details/81868912
1.在服务器未配置php环境变量的情况下,linux要开启web目录下的server.php进程
例如:
cd /home/wwwroot/LNMP02/domain/duoduo1.shupai.xyz/web
/usr/local/php-7.0/bin/php server.php start -d //开启守护进程
2.后台要运行.sh脚本
get_update.sh脚本内容如下:
while [ true ] ;do
curl 'http://duoduo.shupai.xyz/api.php/Lotteryresult/get_stoptime?type=3' >> /dev/null 2>&1;
curl 'http://duoduo.shupai.xyz/api.php/Lotteryresult/get_stoptime?type=2' >> /dev/null 2>&1;
curl 'http://duoduo.shupai.xyz/api.php/Lotteryresult/get_stoptime?type=1' >> /dev/null 2>&1;
curl 'http://duoduo.shupai.xyz/api.php/Sdcupdate/update_lottery_1' >> /dev/null 2>&1;
curl 'http://duoduo.shupai.xyz/api.php/Sdcupdate/update_lottery_2' >> /dev/null 2>&1;
curl 'http://duoduo.shupai.xyz/api.php/Sdcupdate/update_lottery_3' >> /dev/null 2>&1;
sleep 6s;
done;
找到需要执行的脚本文件,后台运行脚本
cd /home/wwwroot/LNMP02/shell
nohup ./get_update.sh >> /dev/null 2>&1