简体   繁体   中英

hostgator cron job not working

I am having a problem in making my cron job to work,

here is the only code in my php file:

sendreport.php

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

and here is the cron job in the cpanel:

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

I am using hostgator.

The cron job should run every 10 am from Monday, Tuesday, Wednesday, Thursday, Friday and Saturday but seems like it is not working.

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. (YES I KNOW THIS IS ALMOST A YEAR OLD - ITS FOR FUTURE PEOPLE)

Cron Job Limits

Shared and Reseller

You may NOT run a cron job more often than every 15 minutes.

Ref: 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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