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
Need help implementing this solution, or still looking for a fix to your Magento problem? Get in touch and I will be happy to help with your project.