Skip to content
🛒 magento🐘 php

Magento How-to: Cron jobs for Modules

1 min read

Written in 2009. It may still be useful, but tools and my own views have probably moved on since.

It’s inevitable that you’ll want to create a cron job for your Magento modules at some point. An obvious solution would be to make the user create a new crontab entry calling your script. There’s no need. Magento has cron functionality built in.

Simply edit your config.xml, adding the following:

When <mode>shipwire/api_inventorysynch::cron</model> relates to the shipwire model namespace, api_inventorysynch relates to the model Meanbee_Shipwire_Model_Api_Invetorysynch and ::cron relates to the method cron() in that class.

Note: You need to make sure, of course, that the script ./cron.php, in the root of your Magento installation, has an entry in the crontab.