1

I've recently setup civicrm as a plugin on my wordpress site, and I can't seem to shake the 'Cron Not Running' Warning.

Does the job.execute cron job need to be running in order to run all other scheduled jobs?

I'm on a digital ocean ubuntu server, and each time i run

sudo -u www-data -- /usr/local/bin/wp --user=cronuser --
url=https://mysite.org --path=/var/www/html civicrm api job.execute 
auth=0

it will run the scheduled tasks, and the system warning will go away(for an hour or so) but this is kind of a 1-off behavior, and it doesn't continue to run any tasks that have already been set up. Eventually, the warning comes back.

Do I need to do something like crontab -e and then:

* * * * * sudo -u www-data -- /usr/local/bin/wp --user=cronuser --
url=https://mysite.org --path=/var/www/html civicrm api job.execute 
auth=0

I'm new to linux administration and I don't want to mess anything up by "guessing" what will work.

1 Answer 1

0

I'm assuming you've seen this Wiki page: https://wiki.civicrm.org/confluence/display/CRMDOC/Managing+Scheduled+Jobs

If I'm reading your question correctly, I think you need to set up the cron job so it runs every so often, e.g. every 15 minutes:

*/15 * * * * <your cron job command here>
3
  • i was thinking id do it every minute, in case some jobs need to be run minutely. is this something that has to be done manually, or should civicrm be managing its own cron jobs/tasks? Because currently, no civicrm cron jobs are running on my plugin, even though they are set up to run
    – heliotrope
    Jul 10, 2017 at 17:28
  • OK, so here's my layman's understanding of how it works. In CiviCRM >> Administer >> System Settings >> Scheduled Jobs you tell Civi which jobs you want to run and when. Then you need a Cron Job that will actually trigger the CiviCRM jobs ... this cron job then runs, say, every fifteen minutes and when it does, it nudges CiviCRM to check which of its jobs need to be run.
    – MtnPavlas
    Jul 10, 2017 at 23:47
  • When the cron job runs, it goes something like this: "Hey, this 'Update membership statuses' job ... it only needs to run once/day ... did it run today yet? Oh, it did, then leave it alone. What about this 'Fetch bounces' one? It's supposed to run every hour and last time it ran was 75 minutes ago... OK, run it now, then." I'm no cron expert, but I'd imagine if you run it every minute, you may overwhelm your system so ask yourself whether it's really necessary.
    – MtnPavlas
    Jul 10, 2017 at 23:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.