Cron jobs in Totara

|
| By Webner

When I made any new changes to the audience or add a new user(s) to existing audience in totara, it didn’t reflect in the member area of that audience. Sometimes it doesn’t even show changes made for many days because of scheduled Cron not running properly and cache not being cleared. So we have to schedule Cron from CLI to run properly. There are a lot of queries on moodle forum regarding this issue with minimum help on most of the threads.

This is because many automated cron jobs have to take a lot of time to reflect the changes. This can be resolved by scheduling cron jobs in totara using recommended settings. In Totara, we schedule jobs through two methods. First with the UI/Web based Script. You can manually run jobs by using it. But there is some permission issue for the jobs, you should manually run one by one script for this.

In our case, we resolved this by using CLI script.

Open terminal in your system.
Use the crontab command to open a crontab editor window for the ‘root’ user

$crontab -e

For User www-data we can use following command

$ crontab -u www-data -e

This is the user that Apache (the web server) runs as on Debian based systems

This will open an editor window. To run the cli cron script every 1 minutes, add the line:

*/1 * * * * /usr/bin/php /path/to/Totara/admin/cli/cron.php >/dev/null

Note:- The final “>/dev/null” sends all the output to the ‘bin’ and stops you getting an email every 1 minutes.

One comment

Leave a Reply

Your email address will not be published. Required fields are marked *