Executing cron tasks manually in Magento

For example, we have this cron task on a config.xml file of a specific module:

1<catgento_sap_sync_nonimages><schedule><cron_expr>*/15 * * * *</cron_expr></schedule><run><model>sap/cron_sync_nonimages::run</model></run></catgento_sap_sync_nonimages>

we can create a new script that loads and executes that cron task like this (create a script.php file and put something like this inside):

1234567<?php//Load Magento APIrequire_once'app/Mage.php';Mage::app();//First we load the model$model= Mage::getModel('sap/cron_sync_nonimage');//Then execute the task$model->run();

The last step would be running this script manually (php script.php).

Leave a Reply

Your email address will not be published.