Heim  >  Fragen und Antworten  >  Hauptteil

crontab - LINUX计划任务如何实现工作时间内1小时执行一次?工作时间外两小时执行一次

工作时间内:09:00 - 17:00 一小时执行一次
工作时间外:18:00 - 08:00 两小时执行一次
周六,周日全天都是非工作时间

这个用crontab能否实现?

PHP中文网PHP中文网2744 Tage vor992

Antworte allen(3)Ich werde antworten

  • 黄舟

    黄舟2017-04-17 14:01:02

    # 工作时间内
    * 9-17/1 * * 1,2,3,4,5 /path/to/your/script 
    # 工作时间外
    * 18-8/2 * * 6,0    /path/to/your/script

    Antwort
    0
  • 伊谢尔伦

    伊谢尔伦2017-04-17 14:01:02

    * 9-17/1 * * 1,2,3,4,5 /etc/init.d/yourcmd yourcmdparam
    * 18-8/2 * * 1,2,3,4,5 /etc/init.d/yourcmd yourcmdparam
    * */2 * * 6,0 /etc/init.d/yourcmd yourcmdparam

    Antwort
    0
  • 大家讲道理

    大家讲道理2017-04-17 14:01:02

    链接
    应该都可以,见上面的链接

    Antwort
    0
  • StornierenAntwort