如何在Magento中设置Cron作业 [英] How to set up a cron job in Magento

查看:217
本文介绍了如何在Magento中设置Cron作业的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以解释一下我该怎么做吗? 我希望Magento清理日志,每天创建一个站点地图.

Can someone please explain me, what I have to do? I want Magento to clean logs, create a sitemap every day.

这是正确的顺序吗?

  1. 在服务器中设置Cron
  2. 在Magento中设置Cron
  3. 下一步将是什么?

如何执行第1步和第2步? 第3步将是什么?我需要等待吗?

How do I do step 1 and 2? What will be step 3? Do I have to wait?

推荐答案

在服务器上设置cron

使用crontab -e编辑您的cron作业.要运行每日cron,请添加以下内容:

Setting up cron on your server

Use crontab -e to edit your cron jobs. To run a daily cron, add a line like this:

0 3 * * *  /bin/sh /path/to/magento/cron.sh

这将在每晚凌晨3点运行.

This will run at 3 AM every night.

要清除日志,可以检查/path/to/magento/shell/log.php.

For log cleaning, you can check /path/to/magento/shell/log.php.

在Magento管理员中,转到:系统">配置">高级">系统">"Cron(计划任务)",然后配置要运行的cron作业.

In the Magento admin, go to: System > Configuration > Advanced > System > Cron (Scheduled Tasks) and configure cron jobs you wish to run.

您应该知道即使没有配置日常cron作业,Magento仍会执行cron作业.每当Magento收到请求时,它都会检查是否有任何cron作业要运行.因此,只有在您一整天都没有要求的情况下,每天进行cron工作才有意义.

You should know that Magento runs cron jobs even if you don't have a daily cron job configured. Whenever Magento receives a request, it checks if there are any cron jobs to be run. Therefore, having the daily cron job would only make sense if you had no requests for an entire day.

真的没有下一步可以做.我建议您阅读如何设置Cron作业.

Really there is no next step to be done. I recommend you read How to Set Up a Cron Job.

这篇关于如何在Magento中设置Cron作业的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆