简体   繁体   English

hostgator cron作业无效

[英]hostgator cron job not working

I am having a problem in making my cron job to work, 我在安排cron工作时遇到问题,

here is the only code in my php file: 这是我的php文件中的唯一代码:

sendreport.php sendreport.php

mail("someone@somewhere.com", "test email", "test message");

and here is the cron job in the cpanel: 这是cpanel中的cron作业:

0 10 * * 1,2,3,4,5,6 php /home/username/public_html/foldername/sendreport.php

I am using hostgator. 我正在使用hostgator。

The cron job should run every 10 am from Monday, Tuesday, Wednesday, Thursday, Friday and Saturday but seems like it is not working. Cron作业应该从星期一,星期二,星期三,星期四,星期五和星期六的上午10点开始运行,但似乎不起作用。

I was wondering if I am doing it correct? 我想知道自己做对了吗?

This has nothing to do with your code. 这与您的代码无关。 Hostgator blocks cronjobs running more frequent then every 15minutes. Hostgator阻止cronjobs运行的频率高于每15分钟一次。 (YES I KNOW THIS IS ALMOST A YEAR OLD - ITS FOR FUTURE PEOPLE) (是的,我知道这已经有一年了-它适合未来的人们)

Cron Job Limits Cron工作限制

Shared and Reseller 共享和转销商

You may NOT run a cron job more often than every 15 minutes. 您执行cron作业的频率不得超过每15分钟一次。

Ref: http://support.hostgator.com/articles/cpanel/what-are-cron-jobs 参考: http : //support.hostgator.com/articles/cpanel/what-are-cron-jobs

To add to what Justin said. 加上贾斯汀所说的话。 Per this article shared and reseller can only fire at most every 15 minutes. 根据这篇文章,共享内容和转销商最多只能每15分钟触发一次。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM