Magento : Execute Custom Module Cron Manually

From Brian Nelson Ramblings
Revision as of 04:06, 31 July 2019 by Brian (Talk | contribs) (Created page with "==Magento1 - Execute Custom Module Cron Manually== let say we have cron setup on config.xml, like this <crontab> <jobs> <alertreminder_abdcart>...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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