duannaikuang1301 2009-05-10 06:36
浏览 41

通过wget / curl长时间的cron工作?

I am working on cron jobs for my php app and planning to use cron via wget/curl. Some of my php cron jobs can take 2-3 hours. How to let php work 2-3 hours from cron tab ? Is it good practice to run such long time jobs via cron wget/curl ? Anyone got experience on this ? I also have email queue and i needs to be run every 10 seconds, but cron tab is minute level. Any suggest on this case ?

Thanks for reading.

  • 写回答

3条回答 默认 最新

  • dou29106 2009-05-10 06:44
    关注

    When you use wget/curl, you are requesting for a page from a webserver. Every webserver will have a time out period, so this might time out.

    Also some of the hosting providers may stop the process running beyond certain minutes ( basically done to control the rogue threads).

    So it is not advisable to schedule using wget/curl if the job takes more than few minutes.

    Try scheduling it using actual scheduler. You can run php from command line

    php [options] [-f] [--] [args...]

    php command should be on the path.

    评论

报告相同问题?

悬赏问题

  • ¥15 微信小程序协议怎么写
  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看