linux - 如何检查Centos的Cron正在运行?
伊谢尔伦
伊谢尔伦 2017-04-17 11:45:51
0
4
476

兄弟好,

我刚接触服务器端,在Centos上设置了定时Cron,每5分钟发一次邮件。

用Crontab -e和 crontab -l检查均显示该cron 正常,并且设置了向我qq邮箱发送提醒的邮件。如下:

# send test email to my adddresses  every 5 minutes 
MAILTO="248672*****@qq.com"
*/5 * * * * /var/www/html/application/controller/email_temporary.php

但实际上发送的任务邮件和提醒邮件均从没有收到。

不知为何?

谢谢!

谢谢大家解答!最后问题发现由于CI的特殊架构必须通过index.php才能运行cron。最后方法:*/5 * * * * php /var/www/html/index.php email_temporary

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all(4)
巴扎黑

First try to run /var/www/html/application/controller/email_temporary.php directly under the shell to see if you can send letters normally. I seriously suspect that this program does not work as you imagine.

洪涛

The program itself can add logs and then look in the /var/log/ directory to see if there is a cron log or if there is some information in the message

黄舟

tail /var/log/cron can see the recently run cron records

巴扎黑

Thank you everyone for your answers! Finally, the problem was discovered that due to the special architecture of CI, cron must be run through index.php. Last method: */5 * * * * php /var/www/html/index.php email_temporary

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template