Elysia Cron status page
Elysia Cron settings page

Elysia Cron extends Drupal standard cron, allowing a fine grain control over each task and several ways to add custom cron jobs to your site.

  • Set the timings and frequencies of each cron task (you can run some jobs every day at a specified hour, other only monthly and so on...). For each task you can simply choose between some frequently used options ("once a day", "once a month" ...), or use a powerful "linux crontab"-like syntax to set the accurate timings. You can even define your frequently used options to speed up site configuration.
  • Parallel execution of cron task: you can group jobs in channels and execute then simultaneously: so a task that takes a lot of time to execute won't block other tasks that need to be executed every 5 minutes...
  • You can disable all tasks, an entire channel or a single task.
  • Change the priority/order of task execution.
  • Manual force the execution of a cron tasks.
  • Detailed overview of cron status with time statistics for single tasks and channels.
  • powerful API for module developers: you can define extra cron tasks for your modules, each one with own default timings (site administrators can override them by configuration, other modules via hook_alter).
  • Administrators can define custom jobs (call to functions with parameters), via the "script" option.
  • Several optimization for frequent cron calls and error handling.
  • Protection from external cron calling by cron_key or allowed host list.

Elysia has no dependencies with contributed modules, and doesn't need to patch the core: it can be used in minimal Drupal installation with only core modules.

3rd party integration:

  • Ping feature, for external tracking services like host-tracker to tell whether cron is functioning properly on your site.
  • Drush support: you can call "drush elysia-cron run" to manually run extended cron.
  • CTools support for exports/backup of task settings.
  • Features support.

USAGE EXAMPLES

Elysia cron is usually used in large sites that needs performance optimization.

  • Avoid drupal peak loads by distributing heavy load tasks during quiet periods of the day: for example you may want to rebuild the XML Sitemap of your site at 2:00AM in the morning, where usually only a few people are visiting your site. You can even move some tasks to be executed only once a month (log rotation, old records expiry...).
  • If you have tasks that should be executed very often, but don't want to execute ALL drupal cron tasks that often! For example, you may want to check for emails that needs to be sent to your users every 2 minutes. Standard cron is managed in a "monolithic" way, so even if you find out how to execute it every 2 minutes, you will end in having all cron tasks executed so often, with a lot of performance problems.
  • Fine tune cron cache management : drupal cron will invalidate variable cache every cron run, and this is a great performance problem if you have a frequently called task. Elysia cron optimize cache management, and doesn't need to invalidate cache.
  • Setup tasks that should be run at a precise time: for example if you want to send a SimpleNews newsletter every monday at 9:00AM, you can do it.
  • Parallel execution: if you have a task that takes a lot of time to execute, you can setup a different channel for it so it won't block other tasks that need to be executed every 5 minutes.
  • Turn off (disable) a cron task/feature you don't need.
  • Debug system cron problems. If your cron does not terminate correctly you can use extended logging, see at each cron timings and disable task to track down the problem.

INSTALL

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.

Drush usage

Run all cron tasks in all active modules for specified site using elysia cron system. This replaces the standard "core-cron" drush handler.

Examples:
 elysia-cron run                           Run all cron tasks in all active modules (as the standard "core-cron") 
 elysia-cron run --verbose                 Run all cron tasks in verbose mode                                     
 elysia-cron run @channel                  Run all cron tasks in specified channel                                
 elysia-cron run search_cron               Run only search index build task (force execution)                     
 --ignore-time                                                                                                    
 elysia-cron list --elysia-cron-verbose    List all channels/tasks in verbose mode                                
 elysia-cron disable search_cron           Disable search index build task

Options:
 --elysia-cron-verbose                     enable extended output (the same as --verbose, but without enabling drush verbose mode) 
 --ignore-disable                          run channels/tasks even if disabled                                                     
 --ignore-maintenance                      run channels/tasks even if maintenance mode is enabled
 --ignore-running                          run channels/tasks even if already running                                              
 --ignore-time                             run channels/tasks even if not ready for execution                                      
 --quiet                                   suppress all output                                                                     
 --verbose                                 enable extended output

API: Example of a module defining its cron jobs

function example_cronapi($op, $job = NULL) {

  $items['example_sendmail_cron'] = array(
    'description' => 'Send mail with news',
    'rule' => '0 */2 * * *', // Every 2 hours
    // Note: i don't need to define a callback, i'll use "example_sendmail_cron"
    // function
  );

  $items['example_news_cron'] = array(
    'description' => 'Send mail with news',
    'rule' => '*/5 * * * *', // Every 5 minutes
    // i must call: example_news_fetch('all')
    'callback' => 'example_news_fetch',
    'arguments' => array('all'),
  );

  return $items;
}

function example_sendmail_cron() {
  // ...
}

function example_news_fetch($what) {
  // ...
}

More info

README.txt (Full overview)
INSTALL.txt (Installation instructions)
API.txt (Module developers API docs)

Credits

Initial development was sponsored by Void Labs s.n.c (http://www.void.it)

DrupalJedi Logo

Supporting organizations: 
Support

Project information

Releases