gpt4 book ai didi

zend-framework - 如何每 12 小时通过 cron 运行 zend 框架操作(在索引 Controller 内)?

转载 作者:行者123 更新时间:2023-12-04 08:25:39 24 4
gpt4 key购买 nike

如何每 12 小时通过 cron 运行 zend 框架操作(在索引 Controller 内)?

案子:

  • 我有由 zf 工具创建的基本(无模块)zend 项目(1.11)。
  • 在主 IndexController 内部存在 cronAction() - url http://mydomain/index/cron .
  • 需要通过 cron 每 12 小时运行一次 cronAction()。

  • 谢谢

    最佳答案

    找到 crontab 文件并添加这一行:

    0 0,12 * * * curl --silent --compressed http://mydomain/index/cron

    您也可以使用其他工具(例如 lynx 或 wget)来执行此操作,而不必使用 curl - 以上只是一个示例。

    关于zend-framework - 如何每 12 小时通过 cron 运行 zend 框架操作(在索引 Controller 内)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6519792/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com