2

是否有人对跨应用程序的多个实例的 Magento 模块级 cron 作业有任何经验?

我知道 Magento 将 cron 记录添加到 cron_schedule 表中 - Magento 应用程序的每个实例都会将它自己的调用添加到模块级 cron 吗?

所有应用程序实例都在查看同一个数据库。

感谢您的任何见解。

4

1 回答 1

3

如果您有多个带有公共数据库的 Magento 副本,那么您将进行多站点安装。只需为一台服务器添加 cron 作业,不需要为任何其他服务器添加 crons。

Magento 不会为您调用 cron,您仍然需要编辑服务器的 crontab。来自Magento 维基

要执行所有这些配置的任务,位于 Magento 根目录中的 cron.php 文件需要定期运行,例如每 15 分钟运行一次。基本上,这个脚本将检查它是否需要运行任何任务,以及是否需要安排任何未来的任务。

在 UNIX/BSD/linux 系统中,您需要将此行(或类似行)添加到您的 crontab:

 # for debugging purposes only:
 MAILTO=your.user@your.server.com

 */5 * * * *  /bin/sh /absolute/path/to/magento/cron.sh

 # /absolute/path/to/bin/php - replace with path to your PHP5 CLI executable
 # example: /usr/local/php5/bin/php-cli

 # in order to find what is the PHP CLI executable you can try to the following command in shell:
 # which php

 # /absolute/path/to/magento/cron.php - replace with path to Magento installation
 # example: /home/user/public_html/magento/cron.php
于 2011-02-14T18:37:12.303 回答