2

I have scheduled job (daily) to email a report to myself. I would like to receive it on a specific time everyday. Although I have set the time when it should run, every time it runs on a different time and keep getting moved forward 20-30 min ahead of when it ran yesterday.

Is it an issue can be fixed easily? Thanks in advance.

2

If you want the jobs to execute at exactly the same time every day, swich it to disabled in the UI and then call that job with its params from a system crontab instead. We do this often for recurring contribution jobs e.g.

Here's an example from one of our clients who in addition to executing the usual CiviCRM scheduled jobs mails out a report at a very specific time -> params are: instanceId=44 and format=pdf (just like in the CiviCRM UI). Note that the /usr/local/bin/vcv-production-all (it's our way to call civicrm's cv) and secureexampleca is this site example and is specific to our docker set up - but crontab is not - it's a UNIX command.

5 * * * * /usr/local/bin/vcv-production-all api job.execute auth=0
1 09 * * * /usr/local/bin/vcv secureexampleca api job.mail_report instanceId=44 format=pdf
3
  • Thanks for tip. Would you please explain a bit what Param to set when setting up the system crontab? – Tapash Dec 12 '20 at 13:10
  • I just stumbled upon this lab.civicrm.org/extensions/cronplus would this work You think? – Tapash Dec 12 '20 at 14:18
  • ☝️ added to my answer – KarinG - Semper IT Dec 12 '20 at 18:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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