How to do a cron job every 72 minutes

后端 未结 7 1058
时光取名叫无心
时光取名叫无心 2020-12-06 10:18

How would I get a cron job to run every 72 minutes? Or some not so pretty number like that?

7条回答
  •  孤街浪徒
    2020-12-06 10:56

    You cannot directly do this from cron/crontab.

    Cron jobs are run on a specific schedule, not on a specific interval.

    One alternative would be to work out a schedule that approximated your "every 72 minutes" by running at midnight, 1:12, 2:24, 3:36, ..., and stretching it out to approximate hitting up at midnight. Your crontab file could specify all of these times as times to execute.

    Another alternative would be to have a separate application handle the scheduling, and fire your application.

提交回复
热议问题