In one of my modules I would like to create two different cron jobs to handle two different procedures. What I did was to use the Ultimate Cron module, and by implementing the cron api, to schedule one of my cron jobs.
My problem is that in /admin/config/system/cron/jobs only the default from the hook_cron appears and not from the hook_cronapi. This is what I wrote.
/**
* Implements hook_cron().
*/
function MODULENAME_cron() {
//code
}
/**
* Implements hook_cronapi().
*/
function MODULENAME_cronapi() {
$items = array();
$items['generate_excel_files'] = array(
'title' => 'Table Excel Generate',
'callback' => 'generate_excel_files_callback',
'scheduler' => array(
'name' => 'crontab',
'crontab' => array(
'rules' => array('0 3 * * *'),
),
),
);
return $items;
}
function generate_excel_files_callback(){
//code
}