public function lastRunAction()
    {
        $code = $this->getArg('code');
        if (empty($code)) {
            echo "\nNo code found!\n\n";
            echo $this->usageHelp();
            exit(1);
        }

        $collection = Mage::getModel('cron/schedule')->getCollection(); /* @var $collection Mage_Cron_Model_Resource_Schedule_Collection */

        $collection->addFieldToFilter('job_code', $code)
            ->addFieldToFilter(
                array('status'),
                array(
                    array('eq' => Aoe_Scheduler_Model_Schedule::STATUS_SUCCESS),
                    array('eq' => Aoe_Scheduler_Model_Schedule::STATUS_REPEAT)
                )
            )
            ->addOrder('finished_at', Varien_Data_Collection_Db::SORT_ORDER_DESC)
            ->getSelect()->limit(1);
        $schedule = $collection->getFirstItem(); /* @var $schedule Aoe_Scheduler_Model_Schedule */
        if (!$schedule || !$schedule->getId()) {
            echo "\nNo schedule found\n\n";
            exit(1);
        }

        $time = strtotime($schedule->getFinishedAt());

        if ($this->getArg('secondsFromNow')) {
            $time = time() - $time;
        }

        echo $time . PHP_EOL;
    }
public function lastRunAction()
    {
        $code = $this->getArg('code');
        if (empty($code)) {
            echo "\nNo code found!\n\n";
            echo $this->usageHelp();
            exit(1);
        }

        $collection = Mage::getModel('cron/schedule')->getCollection(); /* @var $collection Mage_Cron_Model_Resource_Schedule_Collection */

        $collection->addFieldToFilter('job_code', $code)
            ->addFieldToFilter(
                array('status'),
                array(
                    array('eq' => Aoe_Scheduler_Model_Schedule::STATUS_SUCCESS),
                    array('eq' => Aoe_Scheduler_Model_Schedule::STATUS_REPEAT)
                )
            )
            ->addOrder('finished_at', Varien_Data_Collection_Db::SORT_ORDER_DESC)
            ->getSelect()->limit(1);
        $schedule = $collection->getFirstItem(); /* @var $schedule Aoe_Scheduler_Model_Schedule */
        if (!$schedule || !$schedule->getId()) {
            echo "\nNo schedule found\n\n";
            exit(1);
        }

        $time = strtotime($schedule->getFinishedAt());

        if ($this->getArg('secondsFromNow')) {
            $time = time() - $time;
        }

        echo $time . PHP_EOL;
    }
public function lastRunAction ( ) { $ code = $ this -> getArg ( 'code' ) ; if ( empty ( $ code ) ) { echo "\nNo code found!\n\n" ; echo $ this -> usageHelp ( ) ; exit ( 1 ) ; } $ collection = Mage :: getModel ( 'cron/schedule' ) -> getCollection ( ) ; /* @var $collection Mage_Cron_Model_Resource_Schedule_Collection */ $ collection -> addFieldToFilter ( 'job_code' , $ code ) -> addFieldToFilter ( array ( 'status' ) , array ( array ( 'eq' => Aoe_Scheduler_Model_Schedule :: STATUS_SUCCESS ) , array ( 'eq' => Aoe_Scheduler_Model_Schedule :: STATUS_REPEAT ) ) ) -> addOrder ( 'finished_at' , Varien_Data_Collection_Db :: SORT_ORDER_DESC ) -> getSelect ( ) -> limit ( 1 ) ; $ schedule = $ collection -> getFirstItem ( ) ; /* @var $schedule Aoe_Scheduler_Model_Schedule */ if ( ! $ schedule || ! $ schedule -> getId ( ) ) { echo "\nNo schedule found\n\n" ; exit ( 1 ) ; } $ time = strtotime ( $ schedule -> getFinishedAt ( ) ) ; if ( $ this -> getArg ( 'secondsFromNow' ) ) { $ time = time ( ) - $ time ; } echo $ time . PHP_EOL ; }
Returns the timestamp of the last run of a given job

@return void
Returns the timestamp of the last run of a given job