If you navigate your moodle administration side and click on “Notifications” you will probably see this statement:
The cron.php maintenance script has not been run for at least 24 hours.
just like this one:
Unless you have already setup an automated way to accomplish this, you want to setup a simple cronjob to ensure yourself that you will never miss another execution of this task that, as you probably already know, is crucial to moodle.
You actually need access to the machine hosting the webside, but if you cannot, you can do this from wherever you can execute wget or similar on a scheduled basis.
Anyway this brief will cover the technique with nano on debian without taking care on wich machine you are.
- Copy the url linked from the statement in your moodle instalastion->admin area->Notifications
- If you don’t have an open terminal, now it’s time to login into your debian machine
- type “crontab -e”, it will open your cronjob file within nano.
- add this line to your cronjob:
26 04 * * * /usr/bin/wget -q http://<<yourdomain.com>>/admin/cron.php > /dev/null
- press ctrl + “o” <-this is the digit, not the number in order to save your cronjob, do not change the name or the path of the suggested file, it would break the cronjob storage mechanism.
- Then press enter to confirm, and then, finally, ctrl + “x” in order to quit
- If you made any mistake it won’t save and you will be warned about that, carefully review your crontab -e and compare it to one, already present, that works for sure.
Some needed considerations:
First of all remember to use binary programs in crontab jobs with the full path, on some system they could not work.
As you can see i setup the job to be executed at 04:26 each day, and despite it could sounds inadequate, i learned that it is better to use random minutes (and hours too) in order to avoit that two or more jobs are executed at same time, affecting the overall system performance.
That’s all as usual, should you need help, use comments.