Cron not running after upgrade New Version 3.1.3+

Cron not running after upgrade New Version 3.1.3+

by Jeff Mitchell -
Number of replies: 4

Hello All,

We were running 2.8.7 and had to create a script that ran to get cron to work correctly (suggested from some users here). Since upgrading to 3.1.3+ that is not working or at least it doesn't appear to be working.

Here are the two entries in crontab -u www-data -e

*/15 * * * * /usr/bin/wget http://www.wls-online.net/admin/cron.php

*/30 * * * * /usr/bin/wget http://www.wls-online.net/admin/cli/cron.php

Thanks in advance for any help.

Jeff


Average of ratings: -
In reply to Jeff Mitchell

Re: Cron not running after upgrade New Version 3.1.3+

by Jeff Mitchell -

Just wanted to bump this. I am sure it is something simple but I have checked email settings and the cron script which doesn't works if I run it manually either.  Not sure what else to check.  We have classes starting on Jan 2 and I would like to have this running before then.

Jeff

In reply to Jeff Mitchell

Re: Cron not running after upgrade New Version 3.1.3+

by Ken Task -
Picture of Particularly helpful Moodlers

The first crontab shown might require a password.   Check Cron settings for the running of the cron job.   There is an option to run via command line only as well as with a password ... password recommended if using wget.   Choose one or the other ... which ever works, I guess, but not both.

The second crontab shown won't work.  Any script in admin/cli/ is command line only.   That one would have to be something like:

/usr/bin/php /path/to/moodlecode/admin/cli/cron.php

Wget (which is a 'web page getter) and curl (the other option for running cron) would use http protocol.  Both wget and curl are command line utilities which mimic web browser.

That's help?

'spirit of sharing', Ken



In reply to Ken Task

Re: Cron not running after upgrade New Version 3.1.3+

by Jeff Mitchell -

That helps a bit.

I guess what I cannot figure out is why after the upgrade to Debian 8 and Moodle 3.1.3+ now the CRON stops working.  What has changed from Debian 7 to 8 as far as CRON and or SMTP mailing. Even though we're using an SMTP relay from our on Prem email server.

Jeff

 

In reply to Jeff Mitchell

Re: Cron not running after upgrade New Version 3.1.3+

by Randy Thornton -
Picture of Documentation writers

Because Debian 7 and 8 run different versions of PHP, so unless you did something specific in the upgrade to avoid it, your PHP was almost certainly upgraded too, to 5.6.  And it may be in a different place running with a different executable so your cron path is incorrect.

You'll need to locate that on your system. Here's some info: https://packages.debian.org/jessie/php5 to help out.

As Ken mentioned, you really only need to run one cron, the cli cron, from the command line. There's no reason to run both crons or to use wget. Just use the one calling php.

/usr/bin/php /path/to/moodle/admin/cli/cron.php

is the right format, you just need to replace the first part with where your php is actually located.