How can I set cron to run certain commands every one and a half hours?

前端 未结 9 1355
走了就别回头了
走了就别回头了 2020-11-27 18:42

How can I set cron to run certain commands every one and a half hours?

9条回答
  •  粉色の甜心
    2020-11-27 18:48

    That's not possible with a single expression in normal cron.

    The best you could do without modifying the code is:

    0 0,3,6,9,12,15,18,21 * * *  [cmd]
    30 1,4,7,10,13,16,19,22 * * * [cmd]
    

    These might be compressible, depending on the version of cron you have to:

    0 */3 * * * [cmd]
    30 1-23/3 * * * [cmd]
    

提交回复
热议问题