Created
July 26, 2017 13:17
-
-
Save neilbradley/703556640b3971a8aaa4f4eec4cd6509 to your computer and use it in GitHub Desktop.
Get last finished_at time from Magento cron
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$tasks = Mage::getModel('cron/schedule')->getCollection() | |
->addFieldToSelect('finished_at') | |
->addFieldToFilter('job_code', 'orders_exportsales') | |
->addFieldToFilter('status', 'success'); | |
$tasks->getSelect() | |
->limit(1) | |
->order('finished_at DESC'); | |
$lastRun = $tasks->getFirstItem()->getFinishedAt(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment