Linux定时任务

crontab 每分钟、每小时、天天、每周、每个月、每一年定时执行 php

每五分钟执行  */5 * * * *linux

每小时执行     0 * * * *url

天天执行        0 0 * * *spa

每周执行       0 0 * * 0.net

每个月执行        0 0 1 * *orm

每一年执行       0 0 1 1 *blog

linux定时执行url连接crontab

使用了两种办法作计划任务,但均以失败
1.crontab -e里面写的是* * * * * /usr/bin/php http://localhost/nh/index.php/Crontab/addLevel
可是报错:Could not open input file: http://localhost/nh/index.php/Crontab/addLevel(防火墙已经关闭)
2,crontab -e 里面写的是* * * * * /usr/bin/php /home/wwwroot/default/nh/test.php 可是报错:PHP Warning: Cannot modify header information - headers already sent by (output started at /home/wwwroot/default/nh/test.php:2) in /home/wwwroot/default/nh/test.php on line 3
其中第二种方法test.php为get

<?phpinput

Header("Location:http://127.0.0.1/nh/index.php/Crontab/addLevel");

 ?>

相关文章
相关标签/搜索