linux 开启进程,nohup后台运行脚本等

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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值