You are here

cron

Cron, PHP and Drupal development (using the cron hook)

A while back I talked about doing development using the cron hook and how it was not very intuitive to use because if you have an error, it never gets displayed.

There is a handy module called Elysia Cron that allows you to have granular control over your cron jobs and how they are run. You can run functions in your module by clicking on them or set them to run at whatever intervals you want. All Drupal websites that have any sort of custom cron jobs need this module. Unfortunately, there is only a Drupal 6.x stable release right now.

So when you are creating a cron hook in your module, simply create a custom function that does whatever task you need to get done. You can then run this function manually in Elysia Cron to debug and make sure it produces the desired results. And then when its ready for prime time, you can call your custom function in Elysia Cron's configuration, or just add your custom function call in the cron hook function of your module and you are ready to rock.