CRONjob headaches

CRONjob headaches

by W Page -
Number of replies: 7

Hello!

My WebHost is running CPanel 8.8.0-STABLE 74.  They recently upgraded the servers and that is when my problems began. 

The host has offered some solutions but nothing has worked so far.

I have been receiving 400 - 500 e-mail notices a day about the "success" of the MOODLE CRONjob.

In the past, I only received notices if a program CRONjob was not executed successfully. 

I used the following CRONjob for MOODLE in the past.  It worked until the upgrade.  After the upgrade I began to get messages that the CRONjob had failed.
*/5 * * * * wget -q -O /dev/null http://MyWebSite.com/moodle/admin/cron.php

The WebHost's last suggestion was the following.  However as noted above I still receive a CRON e-mail message every 5 minutes that the CRONjob was successfully executed.  Hence, 400 - 500 e-mail notices a day.
*/5 * * * *  php --quiet /home/UserID/public_html/moodle/admin/cron.php

Is there a way I can get the CRONjob to run and not receive e-mail messages unless the CRONjob is not completed properly like I use to??

Thanks in advance for any and all responses.

WP1

Average of ratings: -
In reply to W Page

Re: CRONjob headaches

by John Haywood -

Did you try

/home/user/public_html/moodle/admin/cron.php /dev /null

In reply to John Haywood

Re: CRONjob headaches

by John Haywood -

LOL
I'm having this problem myself now after the same upgrade by my host.

When setting up a Cron Job via the 'Standard' link, there is an option to enter an email address so I'm going to try and either leav that blank or redirect is to an email account that will auto delete the message.

In reply to John Haywood

Re: CRONjob headaches

by W Page -

Hi!

I now use the following which has decreased the number of notices.  I still receive notices when the CRONjob does not go through.  That averages about 1 to 25 a day.  This is still more than I use to get but it is more tolerable.  Also I originally set it using the "standard interface" and saved it there.  For some reason that worked.  When I attempted it using the "Advanced/Unix" interface I could not get it to work.

*/5 0 * * *   wget -q -O /dev/null http://MyWebSite.com/admin/cron.php

Make sure you include the proper path, for example

http://MyWebSite.com/tillytally/moodle/admin/cron.php

I did not want to redirect the messages because I think it is good to know if the CRONjob for that particular script is not working at all so you can intervene early and not when you get a bunch of emails from site visitors/members that they are not getting notices.

I hope this helps.

Oh!  The life of the WebMaster. wink smile big grin

WP1

In reply to W Page

Re: CRONjob headaches

by Chris Mawson -

Hi. I originally emailed WP a possible solution (which worked), but did not post it here as well.

Here is my answer:

------------------------------

Hi.

I am using cPanel 8 also, and have the cron job running OK.

Did you try deleting it and readding it?

The command I am using (via the cPanel Advanced cron interface) is

5 * * * *

wget -q -O /dev/null http://ictpd.net/moodle/admin/cron.php

Note the use of the full URL.

Yours

Chris Mawson

In reply to Chris Mawson

Re: CRONjob headaches

by John Haywood -

My problem seems to be with extra security measures employed by my host.

I cannot use url's and have to use paths.

In reply to John Haywood

Re: CRONjob headaches

by W Page -

I do not know if you have pay hosting or not.  But, some of these pay hosts can be almost the same pain in the B...... the free ones can be.

WP1

In reply to Chris Mawson

Re: CRONjob headaches

by W Page -

Cris posted before I did.  Thank you for the info Chris and yes it did work as I indicated in my response to John.

When I set the "every 5 minutes" in the "Standard" page over time it converted to */5 in the "Advanced/Unix" page.  You may not see it when you first check but after about a day it will not display "5" but it will display "*/5".  Don't ask me why.  I dunno!

I would really like to know why the upgraded CPanel with server changes is causing this problem.  Even my webhost could not figure it out.  But Chris did. smile

WP1