On the cron status page, some cron jobs have a nice descrition, such as:
search_cron Update search database index [run]
statistics_cron Reset day counts / Clean expired access logs [run]

How can i create one for my custom hook_cron() ?
I checked the code for the modules Search and Statistics, but cannot find it.

Comments

gotheric’s picture

You have 2 ways:

- smarter: "hook_cronapi" to define job configuration (description, standard rule...). See API.txt in elysia_cron folder for more info.

function mymodule_cronapi($op, $job = NULL) {
  $items['mymodule_cron'] = array(
    'description' => 'mymodule_description',
    'rule' => '0 0 * * *', // Default rule
  );
  return $items;
}

- quickest: use hook_elysia_cron_description(). For example:

function mymodule_elysia_cron_description($variables) {
  if ($variables['job']) == 'mymodule_cron')
    return 'mymodule_description';
}
johnv’s picture

Status: Active » Closed (works as designed)

Thanx,
I'll use mymodule_cronapi(), to accompany mymodule_cron().