magento - 在 magento 的多个实例上设置 Cron 作业

标签 magento cron amazon-ec2 instances

有人有跨应用程序多个实例的 Magento 模块级 cron 作业的经验吗?

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

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

感谢您提供任何见解。

最佳答案

如果您有多个带有公共(public)数据库的 Magento 副本,那么您就拥有了多站点安装。仅为一台服务器添加 cron 作业,无需为其他服务器添加 cron 作业。

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

To execute all these configured tasks, the cron.php file located in the Magento root will need to be run periodically, for example every 15 minutes. Basically, this script will check if it needs to run any tasks, and if it needs to schedule any future tasks.

In UNIX/BSD/linux systems you will need to add this line (or a similar line) to your crontab:

 # for debugging purposes only:
 <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1b565a52574f542662746e69356e687e695b62746e6935687e696d7e6935787476" rel="noreferrer noopener nofollow">[email protected]</a>

 */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

关于magento - 在 magento 的多个实例上设置 Cron 作业,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4995581/

相关文章:

mysql - Magento -- MySQL 大量 CPU 使用率,然后在批量更新产品类别时失败

css - 为什么在迁移网站时我的 CSS 是从基本主题而不是自定义主题加载的?

ant - "fork: Resource temporarily unavailable"是什么原因

docker - 主机中容器内部的Cron任务

linux - 让 cronjob 在 Ubuntu 中工作

amazon-web-services - 如何在rundeck添加aws ec2?

magento - 在 Magento 中以编程方式更新产品

php - 英国(例如美国或德国)的 Magento 州/省选项下拉列表

amazon-web-services - 向 Amazon AWS ELB 响应添加自定义 header

mysql - 如何在 Amazon EC2 上的 ubuntu 上设置和配置 mysql-proxy