4

Is it possible to have a task (defined in a plugin) be scheduled in Craft to run on a recurring basis without having to use cron?

If so, where do I put those settings (eg, to run a task hourly)?

1 Answer 1

2

Currently not... after all, the task has to be triggered by something (either a cron job or a PHP request to kick it off).

We've discussed the possibility of adding quasi-cron support natively in the future. It wouldn't be 100% accurate, though, since it would still require a PHP request to trigger it. At most you'd be able to say something like "Start this task at 8PM tomorrow", but it wouldn't actually start until the first PHP request that occurs after 8PM tomorrow.

4
  • 2
    For what it's worth, WordPress has the same issue. A lot of people disable WP Cron because it has performance problems and fill in the gaps with a real, system level cron job. Another reason to go for a VPS over shared IMO. I would imagine people who need this also have gzip enabled and need to setup that job anyway. Commented Nov 20, 2015 at 0:39
  • Has it been added yet? Commented Aug 9, 2016 at 18:23
  • Brad is this answer still accurate? I noticed the runTasksAutomatically setting is available and on by default.
    – Simon East
    Commented Jun 14, 2017 at 22:29
  • 1
    @SimonEast We were going to add proper cron job support in Craft 3, but it didn't make the list. Still pretty high on the todo list, though.
    – Brad Bell
    Commented Jun 14, 2017 at 23:30

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.