To add and run a Magento cron job in your module, add the following XML to your modules config.xml:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
<config> <crontab> <jobs> <some_unique_job_code> <schedule> <!-- every minute for example --> <cron_expr>*/1 * * * *</cron_expr> </schedule> <run> <model>module/observer::functionToRun</model> </run> </some_unique_job_code> </jobs> </crontab> </config> |
Thats the first step. Once that was done, you have to manually or automatically run cron.php. Its in your stores root directory. After running cron.php, you should see entries mathcing your new job in the cron_schedule table.
Configuring and running cron jobs
You want or need help implementing this solution? Maybe you did not find what you were looking for? Contact me and I will assist you with whatever Magento problem troubles you!