如何在没有安装cron的情况下手动运行magento cron

时间:2016-06-20 12:14:16

标签: magento cron

手动运行cron.php页面将执行cron job,

如果没有,那么每天只能手动执行一次所有cron脚本 (我们有后端教员手动完成)

3 个答案:

答案 0 :(得分:2)

您可以通过

之类的链接执行
    public function cronAction() {
    //First we load the model
    $model = Mage::getModel('clarion_reviewreminder/observer');
    //Then execute the task
    $model->sendReviewReminder();
}

运行... / cron / action

您在模型中的任务将会停止

答案 1 :(得分:2)

    public function cronAction() 
    {
       //First we load the model
       $model = Mage::getModel('clarion_reviewreminder/observer');
       //Then execute the task
       $model->sendReviewReminder();
    }

答案 2 :(得分:0)

magento根目录中的

php -f cron.php,或runc ./cron.sh或创建运行需要任务的php文件

<?php 
//Load Magento API
require_once 'app/Mage.php';
Mage::app();

//First we load the model
$model = Mage::getModel('sap/cron_sync_nonimage');

//Then execute the task
$model->run();

来源此网站http://catgento.com/2012/10/22/executing-cron-tasks-manually-in-magento/但是为了安全起见,此脚本将在shell文件夹中创建,例如shell/mycron.php,然后您可以php -f shell/mycron.php运行此脚本。

如果你开始做标准工作,你可以看到文件夹shell

  

indexer.php由php -f indexer.php -- help此shell编制索引目录

     

compiler.php由php -f compiler.php运行,此shell将您的实例magento编译为一个文件。

和其他文件shell你可以通过命令ls -l shell/看到这个文件夹,你需要在你的magento根目录中运行这个命令。