Can't ad cron job properly

Can't ad cron job properly

by Alexandru Covtun -
Number of replies: 3

Hi!

Can't add cron job properly to crontab. Still get notifications that cli/cron.php wasn't started for 24hours. This is the comand line 

/usr/bin/php /home/r/russtroyte/ikt/admin/cli/cron.php


Thanks in advance!

Average of ratings: -
In reply to Alexandru Covtun

Re: Can't ad cron job properly

by Darko Miletić -

You should position yourself first in the root of Moodle directory.

cd /home/r/russtroyte/ikt/
/usr/bin/php admin/cli/cron.php


In reply to Darko Miletić

Re: Can't ad cron job properly

by Alexandru Covtun -

Hi Darko Miletić!

First of all I'd like to thank your for your replay. As for a newbie, could you explain please, should I add this line to cron tab or I have to modify it somehow before adding?

In reply to Alexandru Covtun

Re: Can't ad cron job properly

by Matt Bury -
Picture of Plugin developers

Hi Alexandru,

If this helps, you should be doing something like:

$ sudo crontab -u daemon -e

and then edit the cron file by adding:

*/5 * * * * usr/bin/php /home/r/russtroyte/ikt/admin/cli/cron.php >/dev/null

This will run the cron job every 5 minutes. Moodle doesn't run the entire list of cron tasks every time the cron.php script is run so running it frequently, as often as every minute, i.e. */1 * * * * , won't use server resources unnecessarily.

However, I can't see a /htdocs or /public_html directory in the cron path. Are you sure the file path you're using is correct?

I hope this helps! smile