【发布时间】:2016-12-19 01:04:12
【问题描述】:
我一直在尝试在 magento 站点(在子域上)运行 cron 任务
Magento 版本:1.9.2.4 PHP : 5.6我已经从我的 c-panel cron 选项卡中尝试了以下选项
为 cron.php 文件设置 777 权限
选项 1:
*/15 * * * * php -q /home/XXXX/public_html/newmagento/cron.php
选项 2:
0,30 * * * * /bin/sh /home/XXXX/public_html/newmagento/cron.sh
选项 3:
0 * * * * php /home/XXXX/public_html/newmagento/cron.php
但我无法让它与任何选项一起使用
** 对电子邮件中收到的 crons 的响应:**
选项 1:
访问被拒绝。
选项 3:
X-Powered-By:PHP/5.6.14
内容类型:文本/html; charset=UTF-8
访问被拒绝。
选项 2 没有电子邮件回复
看完cmets安装的'aoe scheduler'
未找到心跳任务。检查 cron 是否配置正确。 (见说明)
我按照 AOE 调度程序的指示修改了 cron(来自 c-panel):
- ! 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: 资源暂时不可用 /home/XXXX/public_html/newmagento/scheduler_cron.sh: fork: retry: 资源暂时不可用 /home/XXXX/public_html/newmagento/scheduler_cron.sh:fork:重试:资源 暂时不可用 /home/XXXX/public_html/newmagento/scheduler_cron.sh: fork: retry: 资源暂时不可用 /home/XXXX/public_html/newmagento/scheduler_cron.sh:fork:资源暂时不可用 找不到 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: 资源暂时不可用 /home/XXXX/public_html/newmagento/scheduler_cron.sh: fork: retry: 资源暂时不可用 /home/XXXX/public_html/newmagento/scheduler_cron.sh: fork: retry: 资源暂时不可用 /home/XXXX/public_html/newmagento/scheduler_cron.sh: fork: retry: 资源暂时不可用 /home/XXXX/public_html/newmagento/scheduler_cron.sh:fork:资源暂时不可用! 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: 资源暂时不可用 /home/XXXX/public_html/newmagento/scheduler_cron.sh: fork: retry: 资源暂时不可用 /home/XXXX/public_html/newmagento/scheduler_cron.sh: fork: retry: 资源暂时不可用 /home/XXXX/public_html/newmagento/scheduler_cron.sh: fork: retry: 资源暂时不可用 /home/XXXX/public_html/newmagento/scheduler_cron.sh:fork:资源暂时不可用! 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: 资源暂时不可用 /home/XXXX/public_html/newmagento/scheduler_cron.sh: fork: retry: 资源暂时不可用 /home/XXXX/public_html/newmagento/scheduler_cron.sh: fork: retry: 资源暂时不可用 /home/XXXX/public_html/newmagento/scheduler_cron.sh: fork: retry: 资源暂时不可用 /home/XXXX/public_html/newmagento/scheduler_cron.sh:fork:资源暂时不可用! 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
【问题讨论】:
-
您是否通过安装 `aoe scheduler extension 进行检查?
-
添加这个'aoe调度程序扩展'magentocommerce.com/magento-connect/aoe-scheduler.html
-
nsdlfefinedieicbe 我已经使用 aoe 调度程序扩展对其进行了测试并更新了我得到的结果