Search code examples
magentocron

Create Magento cron job task programmatically


I want to create cron job task programmatically without using config.xml file. Is it possible?


Solution

  • I do not see what is the purpose of that and there is probably a better way to do but I think it should be done like that

    I never had this case but you probably can use the class Mage_Cron_Model_Schedule Mage::getModel('cron/schedule') and set data accordingly, then save. You need to define what is the cron task anyway in a config.xml for magento to be able to associate.

    It should populate the table cron_schedule that it is checked for the cron tasks to be ran.