Hi,

I have a custom module in which in its hook_cron, I call 2 different functions to be triggered during cron.
In the Elysia cron configuration page, I am able to only set a cron time for this custom module's cron tasks as a whole. How can I explicitly split the 2 tasks within the hook_cron to run at different times?

function custom_module_cron() {
    //Cron job 1
    //This needs to run once a week (0 0 * * 0)
    custom_module_month();
    
    //Cron job 2
    //This needs to run once a day (* 19 * * *)
    custom_module_week();
}

Thanks in advance!

Comments

apramakr’s picture

Figured it. Looked in the API.txt file in the Elysia cron module, the hook_cronapi helped.

Thanks!

apramakr’s picture

Status: Active » Closed (works as designed)
lguigo’s picture

In this case, i use elysia script system
In admin/config/system/cron/settings, in script textarea, I write for example :
*/15 * * * * mymodule_cron_test('string_var_example');

and in mymodule.module I create a function :

function mymodule_cron_test($var) {
   // your code here
   // ...
}

it can handle multiple tasks in the same module