I have a custom module where I create several cron tasks using HOOK_cronapi. This is done when the user visits a page and has a form to create those tasks.

I also need that the user can disable those tasks but I can't find anything in the elysia cron documentation on how to disable a cron job.

After it is created I can't disable it programmatically? (I can do it via GUI)


  • 1
    Why not use if (variable_get('some_var', FALSE)) { ... in hook_cronapi()?
    – Clive
    Commented May 11, 2015 at 15:35
  • Nice idea Clive. I think that may solve my problem. Anyway, there should be an option to enable/disable the task.
    – zephirus
    Commented May 11, 2015 at 17:15
  • There doesn't seem to be an option for one per task, but you could create a channel just for those jobs, and then disable the channel (which there is an option for)
    – Clive
    Commented May 11, 2015 at 17:19
  • Clive, do you know how can I enable/disable the channel in my module? I don't see that option either.
    – zephirus
    Commented May 11, 2015 at 18:21
  • elysia_cron_set_channel_disabled('channel_name', TRUE); should do it (or FALSE to enable)
    – Clive
    Commented May 11, 2015 at 18:28

1 Answer 1


I realize this is pretty old but if you are only concerned with one task and not a whole channel...

elysia_cron_set_job_disabled('mymodule_cron', true);

will disable a cron job. Not surprisingly,

elysia_cron_set_job_disabled('mymodule_cron', false);

enables it again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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