Linux 执行ThinkPHP 文件的计划任务

执行例如 http://192.168.1.32/index.php?s=/Home/Cron/yue 这样的 url 的计划任务

方式①

*/1 * * * * curl http://192.168.1.32/index.php?s=/Home/Cron/yue

注意修改完计划任务之后要重启 cron 服务:

sudo service cron restart  

 root 用户直接:

service cron restart  

 

或者

*/1 * * * * wget http://192.168.1.32/index.php?s=/Home/Cron/yue

这两种命令。

 

方式②

0 0 * * * /usr/local/php/bin/php /home/wwwroot/*****.com/index_cli.php Cron repay type online   >> /tmp/log/t.newftd.txt  2>&1

其中 Cron 是控制器名,repay 是方法名

posted @ 2015-04-15 13:23  nemo20  阅读(780)  评论(0)    收藏  举报
访客数:AmazingCounters.com
2016/05/17 起统计