linux定时执行PHP文件+httpsqs

1、消息队列httpsqs操作见: http://blog.s135.com/httpsqs/

2、编写sh文件:
/usr/local/php/bin/php -q /var/www/html/httpsqs/example.php
保存为test.sh;
ps:/usr/local/php/bin/php为php安装目录;

3、编辑crontab文件,#crontab -e 输入:
*/1 * * * * sh /var/www/html/httpsqs/test.sh >> /var/www/html/httpsqs/out1.log
重启:/etc/init.d/crond  restart
每隔一分钟执行一次sh文件;
ps:crontab详细操作见: http://www.cnblogs.com/OtisBlog/archive/2012/01/30/2332175.html

你可能感兴趣的:(linux)