linux后台启动sh文件

后台启动文件

nohup  /web/a/sh/crontab.sh &

查看端口 ps
-aux | grep crontab

后台启动php文件
php start.php start -d

 crontab.sh文件

#!/bin/bash  
  
step=1 #间隔的秒数,不能大于60  
  
for (( i = 0;i>-1; i=(1+step) )); do  
    /usr/local/php/bin/php /web/a/sh/crontab.php  
    sleep $step  
done  
  
exit 0 

crontab.php文件

<?php 

$obj=shell_exec("curl http://www.xxx.com/api/lucky");
//var_dump($obj);
原文地址:https://www.cnblogs.com/zhangyouwu/p/12793512.html