Best practice forum (Archived)

Scheduled Tasks - "Your cron is not run very regularly"

 
John Unnever
Scheduled Tasks - "Your cron is not run very regularly"
by John Unnever - Thursday, 2 November 2017, 7:01 AM
Group Partners

Hello, 

In one of our environments we are seeing the message "Your cron is not run very regularly. We recommend configuring the cron to run every minute, this way scheduled tasks will run as configured below and system load will be minimized."

The scheduled tasks are not running properly, most say their next run is ASAP. However, it is setup in the crontab to run every minute.  Anyone know what might be causing this?  Does having the checkbox UNCHECKED to allow it to be run from the URL have any impact on the CLI version being called by Cron?   This is our test environment so we have it setup to be able to run from the URL as well when needed.   Our Systems Administrator assures us he's got this setup in Cron the same way it is in all of our other environments that are working properly.  I'm not sure why but he's got 2 entries calling the same cron.php page as below.. could that be causing something to go wrong?

* * * * * php /opt/hrms/test/html/admin/cli/cron.php >> /opt/hrms/logs/test.totaraCron.log 2>&1
0 0 * * 0 php /opt/hrms/test/html/admin/cli/cron.php > /opt/hrms/logs/test.totaraCron.log 2>&1

me
Re: Scheduled Tasks - "Your cron is not run very regularly"
by George Angus - Thursday, 2 November 2017, 3:40 PM
Group Totara

Hi John,

Could you ask your Systems admin why he has set up cron like it is and if it could be causing something to go wrong?

George.

Ray Lawrence
Re: Scheduled Tasks - "Your cron is not run very regularly"
by Ray Lawrence - Wednesday, 8 November 2017, 3:28 AM
Group Partners

Are they running too regularly and are not finishing?

Tom Ireland
Re: Scheduled Tasks - "Your cron is not run very regularly"
by Tom Ireland - Wednesday, 8 November 2017, 2:33 AM
Group Totara

Hi, John

It could well be the cron setup which is causing the issue. I've not tested what happens with more than one entry which points to the same file, but my guess is it could cause a problem.

The first job is set up to run every minute and the second looks like it's set to run at midnight on Sunday.

I would remove the second entry and use the first one.

* * * * * php /opt/hrms/test/html/admin/cli/cron.php >> /opt/hrms/logs/test.totaraCron.log 2>&1

I would also check to see if PHP is in your path, or whether you have to specify the path e.g. /usr/bin/php

Let us know if the information was useful, John.

Cheers.

Tom

John Unnever
Re: Scheduled Tasks - "Your cron is not run very regularly"
by John Unnever - Wednesday, 8 November 2017, 8:12 AM
Group Partners

Our system administrator says the second entry in the cron is to clear the log file each sunday.  He's got it setup this way in all of our other environments.. which do not have this issue.

Tom Ireland
Re: Scheduled Tasks - "Your cron is not run very regularly"
by Tom Ireland - Friday, 10 November 2017, 2:28 AM
Group Totara

Hi, John

Thanks for your reply.

It sounds like some more details need to be gathered to investigate this further and this level of support is beyond the scope of the community.

Please can you contact your Partner for support and, if required, they can create a helpdesk ticket to obtain further support from us if they cannot help you resolve the issue.

Cheers.

Tom