Php magento中的cronjob未执行/返回错误
好的,我有个小问题。 如果有人看到它并能马上帮助我,那就太好了 情况: 需要重新编制索引,以便在广泛的产品操作过程中解决问题 这是我的config.xmlPhp magento中的cronjob未执行/返回错误,php,mysql,magento,cron,Php,Mysql,Magento,Cron,好的,我有个小问题。 如果有人看到它并能马上帮助我,那就太好了 情况: 需要重新编制索引,以便在广泛的产品操作过程中解决问题 这是我的config.xml <?xml version="1.0" encoding="UTF-8"?> <config> <modules> <XXXXXXX_XXXXXXXX> <version>x.xxx.xxx</version> </XXXXX
<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
<XXXXXXX_XXXXXXXX>
<version>x.xxx.xxx</version>
</XXXXXXX_XXXXXXXX>
</modules>
<global>
<models>
<rebuildindex>
<class>XXXXXXX_XXXXXXXX_Model_Index</class>
</rebuildindex>
</models>
</global>
<crontab>
<jobs>
<xxxxxxxx_rebuildindex>
<schedule><cron_expr>* * * * *</cron_expr></schedule>
<run><modul>rebuildindex/observer::build</modul></run>
</xxxxxxxx_rebuildindex>
</jobs>
</crontab>
</config>
我试着按照以下方式实施:
但它根本不起作用看不到任何眼前的问题。我建议安装以更好地了解cron是如何运行的。嗯,我注意到其中一个已成功执行,但我看不到它是否已执行:(据我所知,它执行任务,但没有写入主系统。已启用logIs日志记录功能?您尝试过强制日志记录吗?
Mage::log('foo',null'system.log',true);
已启用登录。我还从其他调试注释中获取调试消息。(如果我通过前端访问模块)
<?php
class XXXXXXX_XXXXXXXX_Model_Index_Observer{
const CHECKTIME = 300;
public function build(){
Mage::log('build');
if(file_exists('pathtofile')){
$atime = (int)file_get_contents('pathtofile');
Mage::log($atime);
if($atime>0 && $atime<(time()-$this->CHECKTIME)){
@unlink('pathtofile');
$processCollection = Mage::getSingleton('index/indexer')->getProcessesCollection();
$processCollection->walk('reindexAll');
Mage::app()->cleanCache();
}
}
}
}
exception 'Mage_Core_Exception' with message 'No callbacks found' in /pathtomagento/app/Mage.php:594
Stack trace:
#0 /pathtomagento/app/code/core/Mage/Cron/Model/Observer.php(99): Mage::throwException('No callbacks fo...')
#1 /pathtomagento/app/code/core/Mage/Core/Model/App.php(1338): Mage_Cron_Model_Observer->dispatch(Object(Varien_Event_Observer))
#2 /pathtomagento/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Mage_Cron_Model_Observer), 'dispatch', Object(Varien_Event_Observer))
#3 /pathtomagento/app/Mage.php(447): Mage_Core_Model_App->dispatchEvent('default', Array)
#4 /pathtomagento/cron.php(45): Mage::dispatchEvent('default')
#5 {main}