The cli/cron.php maintenance script has not been run for at least 24 hours.

The cli/cron.php maintenance script has not been run for at least 24 hours.

by Delbert Warkentin -
Number of replies: 3

I have this message in "Notifications" and am wondering why since my server is scheduled to run cron. I have it set to every minute with this line. I´ve checked the log files and I can see that cron has run in the past. Could it be because I have it in a subdomain or something like that?

/opt/cpanel/imh-php70/root/usr/bin/php -q /home/uepedu/my.domain.edu/admin/cli/cron.php

I ran it manually once (web based with password) to see if the message would disappear and it did for 24 hours. Then it showed up again.

Moodle Version: 3.6.2 (Build: 20190114)


Average of ratings: -
In reply to Delbert Warkentin

Re: The cli/cron.php maintenance script has not been run for at least 24 hours.

by Ken Task -
Picture of Particularly helpful Moodlers

The cli cron.php script must be run from the command line (that's what is supposed to happen with cron)

From a shell as user on your server, what's the output of:

/opt/cpanel/imh-php70/root/usr/bin/php -v

That command with the -v is seeking the version of php-cli (note that's not the same as php for web service).

If that /path/php is finding php-cli the top line of output will look something like:

PHP 7.0.## (cli) ... other info ...

See the (cli).

To find php-cli on your system is kinda an adventure.

Using ssh issue: find / -name php

That will probably display paths + php at the end.

For every one of those paths+php it shows, try the -v switch until find one that shows it's php-cli.

If your moodle is set to use php 7.0.x (seen in phpinfo of Site Admin) ... then use the path to 7.0.x

Before entering path+php into cron job however, test it from command line so you know it works.

Also, if you are running Moodle 3.6.x there is now a path setting in the Moodle admin interface that should be filled in.

'spirit of sharing', Ken



In reply to Ken Task

Re: The cli/cron.php maintenance script has not been run for at least 24 hours.

by Delbert Warkentin -

Hi Ken,

Thanks for your response. However I´m not sure what you are getting at. The cron script that I have running is from the command line. The issue that I have is that there is a cron job that is running but it is not appearing in moodle or it is not running the one that moodle needs to be run.

In reply to Delbert Warkentin

Re: The cli/cron.php maintenance script has not been run for at least 24 hours.

by Ken Task -
Picture of Particularly helpful Moodlers

Now this is confusing ...  'issue that I have is that there is a cron job that is running but it is not appearing in moodle or it is not running the one that moodle needs to be run.'

Do you have ssh access to your server?

If so, humor me ... enter php -v [ENTER].

If so, humor me ... and run:

/opt/cpanel/imh-php70/root/usr/bin/php -v

come back here and share what that showed!

IF so, use the same command as configured in your cron setup from command line - just the basic command without any options/switches NOR the redirects at the end ... ie, NO >whatever.

/opt/cpanel/imh-php70/root/usr/bin/php (NO -q) /home/uepedu/my.domain.edu/admin/cli/cron.php

The imh in the command above indicates you are hosted on InMotion Hosting.   They do have tutorials and a helpdesk for customers.   Have you checked those resources of help/assistance?

Run that several times as a task may not be scheduled to run until later.

The cron job consist of 'task'.   Look at your moodles 'scheduled task' for a clue as to which/what isn't running successfully.

'spirit of sharing', Ken


Average of ratings: Useful (1)