Linux, Magento

Adding a Cron Job in Magento

Add the following lines to your module’s config.xml file under etc folder.




                <schedule><cron_expr>*/1 * * * *</cron_expr></schedule>








class Namespace_Yourmodulename_Model_Observer {

public static function methodToCall(){

//Code to Execute

Mage::log(“Cron Executed”);




Note: Magento root file cron.php needs to be added to crontab on web server.

You Might Also Like

  • rc toys

    This is cool!