0

I am trying to understand how Elysia Cron works. If I execute the cron through a curl/wget requests, will the elysia cron still run normally without risking timeouts? Are there any advantages to running it through Drush rather than curl/wget?

1 Answer 1

3

The module page is fairly clear ...

For the basic install you only need to enable the module and Elysia Cron will be up and running.

You can stop here if you don't need a great precision over task execution and you don't have to execute a task more often than once an hour. For example, if you need only the "Once a day", "Once a week" or "Once a month" schedule rules the basic install is fine. (For D6 users that want to stop here: you should have installed Drupal crontab as described in Drupal INSTALL guide).

However to get the full potential out of elysia cron and have the full control over you tasks a further step is needed: you need to configure the system crontab to execute drupal cron every minute. Follow the Drupal guide about this: http://drupal.org/cron The only difference is that you should use the "* * * * *" rule part instead of "0 * * * *" or "45 * * * *" as described in the guide.

Cron is a server thing, not a Drupal thing. Hook_cron is a nice PHP interface to stuffing custom tasks into the file http://www.mysite.com/cron.php which Drupal's Poor Man's cron or ElysiaCron can use to run your tasks.

As the above notes -- if you just need daily runs, weekly runs, monthly runs -- simply enable the barebones Elysia or Drupal cron. For more fine grained control over cron tasks they recommend a system crontab entry that polls Drupal cron every minute. Elysia's task management logic checks what tasks it has to do in X timeperiod every minute (whats Done, what is to begin, whats running, etc). This is the power of Elysia cron and also UltimateCron.

Whenever a browser hits cron.php you are subject to timeouts -- even if programming attempts to avoid it (such as the Batch API, which can sometimes timeout and fail -- eg what happens when your webserver (Apache) is under load and the next cron.php call is never successfully handled?).

By running via Drush you are 100% free of worrying about webserver timeouts -- because its now a server side PHP script which may run indefinately.

  • 1 advantage of running through Drush is you can pipe output from your cron tasks (there shouldnt really be any) to a custom file.

You can invoke a Cron run directly using Drush via: drush cron for all options to Drush cron see drush help cron

3
  • Thank you. This is exactly what I thought too. I am afraid of timeout. Also configuring the cron for elysia cron requires hitting sites/modules/contrib/elysia_cron/cron.php instead of normal drupal cron.php. In any case, your answer verify my understanding that elysia cron logic is independent from how the cron setup.
    – awm
    Jul 9, 2013 at 4:29
  • 3
    Elysa cron is invoked with drush elysia-cron.
    – jonhattan
    Jul 9, 2013 at 8:11
  • Yes, if you are doing the cron using drush but not with curl/wget.
    – awm
    Jul 9, 2013 at 15:19

Your Answer

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

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