Drupal 6 possible noob question. Is there a way to get a list of cron tasks from the Drupal 6 Admin? I am a themer for the site. The original dev is long gone. Everyone complains of slowness and 500.shtml errors. I looked in the log and noticed that these are most often associated with a cron task that runs hourly. But I can't see what those jobs are. Once I get the list is there also a way to disable unneeded tasks from within Drupal?

I'm running Windows on my client machine. I don't have DRUSH.

Thanks In Advance

  • 1
    If you by chance happen to have Elysia Cron installed, you may be able to get a good enough idea through its admin interface, otherwise you basically will have to look through your modules' source code and look for hook_cron(), eg, `function MODULENAME_cron()' and then see what's happening in each.
    – Jimajamma
    Aug 13 '13 at 21:35
  • Try this module. drupal.org/project/ultimate_cron. The Ultimate Cron handling for Drupal. Runs cron jobs individually in parallel using configurable rules, pool management and load balancing. It is like Elysia cron in D7 Aug 4 '17 at 12:25

If you don't have Elysia Cron installed, and from a purely debugging standpoint, if you want or need to see what module's cron is running, as well as how long it is taking to run, you can TEMPORARILY edit includes/common.inc's drupal_cron_run() function like so...

// Iterate through the modules calling their cron handlers (if any):
// module_invoke_all('cron'); // watchdog how long each hook takes now...

foreach (module_implements('cron') as $module) {
  $function = $module . '_cron';
  $duration=$finish - $start;
  $details.='<pre>' . $module . ': ' . $duration . ' seconds</pre>';

// Record cron time
variable_set('cron_last', time());
watchdog('cron', 'Cron run completed.' . $details, array(), WATCHDOG_NOTICE); // . in $details here :)

eg, comment out the module_invoke_all() and instead loop through via module_implements() and log how long each individual cron run takes.

  • Can I just add the Elysia module? I looked in the cPanel and the cron from Drupal is executing hourly. Will Elysia give me details on what -Drupal- is doineg every hour? All I see is a wget. A lot of the 500 errors we get occur right after this.
    – jchwebdev
    Aug 21 '13 at 5:28
  • Does this trick apply for D7 too?
    – cdmo
    Jan 8 '14 at 20:06
  • D7 does it a bit differently but sure, you could add some microtime()s to its version temporarily as well.
    – Jimajamma
    Jan 8 '14 at 20:17

Or simple use

drush ev 'var_dump(module_implements("cron"))'

For list the cron job that exists.

  • Hello and welcome. This provide an answer, but is now formatted in a way that makes it look like a comment. Could you please edit it to make it look like a standalone entity and not a voice in conversation? This is Q&A site and not a forum, after all :)
    – Mołot
    Oct 11 '13 at 6:49
  • This only tells you which modules have a cron installed, which is a nice start, but it'd be nicer to see exactly what each individual task was.
    – cdmo
    Jan 8 '14 at 20:09

For Drupal 8/9, you can simply use the following command:

drush php-eval 'var_dump(\Drupal::moduleHandler()->getImplementations("cron"))'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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