Skip to content

Instantly share code, notes, and snippets.

@neilbradley
Created July 26, 2017 13:17
Show Gist options
  • Save neilbradley/703556640b3971a8aaa4f4eec4cd6509 to your computer and use it in GitHub Desktop.
Save neilbradley/703556640b3971a8aaa4f4eec4cd6509 to your computer and use it in GitHub Desktop.
Get last finished_at time from Magento cron
$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