You are here

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.

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.