Executing cron tasks manually in Magento

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

<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):

//Load Magento API
//First we load the model
$model= Mage::getModel('sap/cron_sync_nonimage');
//Then execute the task

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

Leave a Reply