首页 文章

Cron任务不适用于magento 1.9.2

提问于
浏览
1

我一直在尝试在magento站点上运行cron任务(在子域上)

Magento version : 1.9.2.4 
PHP  :  5.6

我在c-panel cron选项卡中尝试了以下选项

为cron.php文件设置777 permssions

Option 1 :

  • / 15 * * * * php -q /home/XXXX/public_html/newmagento/cron.php

Option 2 :

0,30 * * * * / bin / sh /home/XXXX/public_html/newmagento/cron.sh

Option 3:

0 * * * * php /home/XXXX/public_html/newmagento/cron.php


但我无法使用任何选项

对电子邮件中收到的crons的回复:

Option 1 :

拒绝访问 .

Option 3 :

X-Powered-By:PHP / 5.6.14

内容类型:text / html;字符集= UTF-8

拒绝访问 .

There is no email response for option 2


After reading the comments installed 'aoe scheduler'

没有找到心跳任务 . 检查cron是否配置正确 . (见说明)

我修改了cron(来自c-panel),如AOE调度程序所示:

  • ! test -e /home/XXXX/public_html/newmagento/maintenance.flag && / bin / bash /home/XXXX/public_html/newmagento/scheduler_cron.sh --mode always --includeGroups my_queue_jobs

  • ! test -e /home/XXXX/public_html/newmagento/maintenance.flag && / bin / bash /home/XXXX/public_html/newmagento/scheduler_cron.sh --mode always --excludeGroups my_queue_jobs

  • ! test -e /home/XXXX/public_html/newmagento/maintenance.flag && / bin / bash /home/XXXX/public_html/newmagento/scheduler_cron.sh --mode default --includeGroups groupA,groupB

  • ! test -e /home/XXXX/public_html/newmagento/maintenance.flag && / bin / bash /home/XXXX/public_html/newmagento/scheduler_cron.sh --mode default --includeGroups groupC

  • ! test -e /home/XXXX/public_html/newmagento/maintenance.flag && / bin / bash /home/XXXX/public_html/newmagento/scheduler_cron.sh --mode default --excludeGroups groupA,groupB,groupC * / 10 * * * *! test -e /home/XXXX/public_html/newmagento/maintenance.flag && cd / home / XXXX / public_html / newmagento / shell && / usr / bin / php scheduler.php --action watchdog

完成所有这些后,我在电子邮件中得到以下结果

! test -e /home/XXXX/public_html/newmagento/maintenance.flag && /bin/bash /home/XXXX/public_html/newmagento/scheduler_cron.sh --mode always --includeGroups my_queue_jobs

/home/XXXX/public_html/newmagento/scheduler_cron.sh: fork: retry: Resource temporarily unavailable

/home/XXXX/public_html/newmagento/scheduler_cron.sh: fork: retry: Resource temporarily unavailable

/home/XXXX/public_html/newmagento/scheduler_cron.sh: fork: retry: Resource 
temporarily unavailable

/home/XXXX/public_html/newmagento/scheduler_cron.sh: fork: retry: Resource temporarily unavailable

/home/XXXX/public_html/newmagento/scheduler_cron.sh: fork: Resource temporarily unavailable

Could not find a binary for php

! test -e /home/XXXX/public_html/newmagento/maintenance.flag && /bin/bash /home/XXXX/public_html/newmagento/scheduler_cron.sh --mode always --excludeGroups my_queue_jobs

/home/XXXX/public_html/newmagento/scheduler_cron.sh: fork: retry: Resource temporarily unavailable
    /home/XXXX/public_html/newmagento/scheduler_cron.sh: fork: retry: Resource temporarily unavailable
    /home/XXXX/public_html/newmagento/scheduler_cron.sh: fork: retry: Resource temporarily unavailable
    /home/XXXX/public_html/newmagento/scheduler_cron.sh: fork: retry: Resource temporarily unavailable
    /home/XXXX/public_html/newmagento/scheduler_cron.sh: fork: Resource temporarily unavailable

! test -e /home/XXXX/public_html/newmagento/maintenance.flag && /bin/bash /home/XXXX/public_html/newmagento/scheduler_cron.sh --mode default --includeGroups groupC

/home/XXXX/public_html/newmagento/scheduler_cron.sh: fork: retry: Resource temporarily unavailable
/home/XXXX/public_html/newmagento/scheduler_cron.sh: fork: retry: Resource temporarily unavailable
/home/XXXX/public_html/newmagento/scheduler_cron.sh: fork: retry: Resource temporarily unavailable
/home/XXXX/public_html/newmagento/scheduler_cron.sh: fork: retry: Resource temporarily unavailable
/home/XXXX/public_html/newmagento/scheduler_cron.sh: fork: Resource temporarily unavailable

! test -e /home/XXXX/public_html/newmagento/maintenance.flag && /bin/bash /home/XXXX/public_html/newmagento/scheduler_cron.sh --mode default --includeGroups groupA,groupB

/home/XXXX/public_html/newmagento/scheduler_cron.sh: fork: retry: Resource temporarily unavailable
/home/XXXX/public_html/newmagento/scheduler_cron.sh: fork: retry: Resource temporarily unavailable
/home/XXXX/public_html/newmagento/scheduler_cron.sh: fork: retry: Resource temporarily unavailable
/home/XXXX/public_html/newmagento/scheduler_cron.sh: fork: retry: Resource temporarily unavailable
/home/XXXX/public_html/newmagento/scheduler_cron.sh: fork: Resource temporarily unavailable

! test -e /home/XXXX/public_html/newmagento/maintenance.flag && /bin/bash /home/XXXX/public_html/newmagento/scheduler_cron.sh --mode default --excludeGroups groupA,groupB,groupC

/bin/bash: fork: retry: Resource temporarily unavailable
/bin/bash: fork: retry: Resource temporarily unavailable
/bin/bash: fork: retry: Resource temporarily unavailable
/bin/bash: fork: retry: Resource temporarily unavailable
/home/XXXX/public_html/newmagento/scheduler_cron.sh: fork: retry: Resource temporarily unavailable
Status: 500 Internal Server Error
X-Powered-By: PHP/5.6.14
Content-type: text/html; charset=UTF-8

! test -e /home/XXXX/public_html/newmagento/maintenance.flag && cd /home/XXXX/public_html/newmagento/shell && /usr/bin/php scheduler.php --action watchdog

Status: 500 Internal Server Error
X-Powered-By: PHP/5.6.14
Content-type: text/html; charset=UTF-8

1 回答

  • 0

    尝试输出到日志文件以捕获错误,如

    0,30 * * * * / bin / sh /home/XXXX/public_html/newmagento/cron.sh >> path_to / magneto / var / filename.log

    在magento var log文件夹中使用日志文件是理想的 .

    当您选择运行cron.php文件时,请确保php二进制文件并将其与路径一起使用 . 要查找路径,请使用以下命令

    >which php
    

相关问题