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

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

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

9条回答
  •  半阙折子戏
    2020-11-27 19:14

    */10 * * * * root perl -e 'exit(time()%(90*60)>60)' && command

    90 — it is one and a half hour in minutes

    "> 60" — I give to cron ability to delay the start of script during a minute

    Also with help of this hack you can set any period with a minute resolution

    For example start the script every 71 minutes

    * * * * * root perl -e 'exit(time()%(71*60)>60)' && command

提交回复
热议问题