Magento : Execute Custom Module Cron Manually

From Brian Nelson Ramblings
Jump to: navigation, search

Magento1 - Execute Custom Module Cron Manually

let say we have cron setup on config.xml, like this

<crontab>
        <jobs>             
	    <alertreminder_abdcart>
                <schedule><cron_expr>*/5 * * * *</cron_expr></schedule>
                <run><model>alertreminder/cron::Abdcart</model></run>
            </alertreminder_abdcart>            
        </jobs>
    </crontab>

and then a functions ready to execute

class AN_Alertreminder_Model_Cron{	
	public function Abdcart(){
		//do something
      }
}

Setup Manual Script

vim abdcart_cron.php

Add the following

<?php
$model = Mage::getModel('alertreminder/cron');
$model->Abdcart();
?>

Setup to run via your own cron:

crontab -e

Add the following:

* * * * * /path/magento/shell/abdcart_cron.php