【问题标题】:Dynamic cron Magento动态 cron Magento
【发布时间】:2014-02-05 19:09:31
【问题描述】:

如何在 Magento 模块上的 config.xml 上设置 cron 时间?

类似:

 <crontab>
        <jobs>
            <captcha_delete_old_attempts>
                <schedule>
                    <cron_expr><!--dynamic info here--></cron_expr>
                </schedule>
                <run>
                    <model>captcha/observer::deleteOldAttempts</model>
                </run>
            </captcha_delete_old_attempts>
            <captcha_delete_expired_images>
                <schedule>
                    <cron_expr><!--dynamic info here--></cron_expr>
                </schedule>
                <run>
                    <model>captcha/observer::deleteExpiredImages</model>
                </run>
            </captcha_delete_expired_images>

        </jobs>
    </crontab>

【问题讨论】:

    标签: xml magento magento-1.7 crontab


    【解决方案1】:

    通过以下代码动态设置 cron

    <crontab>
    <jobs>
      <module_name>
          <schedule>
              <cron_expr>23 9 * * *</cron_expr>
            </schedule>
            <run>
                <model>module name/model name::function name</model>
            </run>
       </module_name>
     </jobs>
    </crontab>
    

    使用下面的链接,您只需检查 cron 动态时间 https://crontab.guru/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-02-26
      • 2023-03-18
      • 2015-12-13
      • 1970-01-01
      • 2014-01-14
      • 2015-06-27
      • 2011-07-02
      相关资源
      最近更新 更多