Magento Cron 选项卡作业时区
我试图弄清楚我的模块 cron 是否在正确的时间运行。
我的模块的 cron 设置为凌晨 1 点(0 1 * * *),默认商店的时区是西欧(巴黎、柏林等 GMT +2),服务器时间是 EDT(东部夏令时间)。
那么凌晨 1 点的时间表是基于哪个时区的呢?
谢谢,
Im trying to figure out if my module cron is running at the correct time.
The cron for my module is set at 1am (0 1 * * *), the time zone of the default store is Western Europe (Paris, Berlin etc GMT +2), the server time is EDT (Eastern Daylight Time).
So on which time zone is the 1am schedule based on?
Thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Magento cron 进程在 UTC 时区下运行。
这可以通过临时向 cron 观察器添加一条小日志语句来验证。
方法是:
在前几行中查找此代码:
在之前或之后添加以下内容:
然后检查 var/log/system.log 文件,您将看到 PHP/Magento 使用 UTC 时区。
The Magento cron process runs under the UTC timezone.
This can be verified by temporarily adding a small log statement to the cron observer.
The method is:
Look for this code in the first few lines:
Either right before or after, add this:
Then check your var/log/system.log file and you will see that PHP/Magento is using the UTC timezone.
Magento cron 作业日志时间以 UTC 记录。实际运行时间基于 TZ 偏移(服务器时间)。这是一个 Cron Job Monitor 脚本,它向您显示计划的作业以及它们的完成时间。它还为您提供 UTC、服务器时间和您的商店时间(单个商店)。这三个都可以不同。
Cron Job Monitor
为了使其有用,我将系统配置设置为保留错误并24小时记录信息。这样您就可以实际监控凌晨运行的大型作业并确认它们确实在运行。
The Magento cron job log times are recorded in UTC. Actual run times are based off the TZ offset (server time). Here's a Cron Job Monitor script that shows you the jobs as they're scheduled and then their completion times. It also gives you UTC, the server time and your store time (single store). All three can be different.
Cron Job Monitor
For it to be useful, I set System Config to keep errors and logged information for 24 hours. That way you can actually monitor the big jobs that run in the early AM and confirm they're really running.