How to get a unix script to run every 15 seconds?

前端 未结 9 611
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-28 19:35

I\'ve seen a few solutions, including watch and simply running a looping (and sleeping) script in the background, but nothing has been ideal.

I have a script that ne

9条回答
  •  囚心锁ツ
    2020-11-28 19:57

    I would use cron to run a script every minute, and make that script run your script four times with a 15-second sleep between runs.

    (That assumes your script is quick to run - you could adjust the sleep times if not.)

    That way, you get all the benefits of cron as well as your 15 second run period.

    Edit: See also @bmb's comment below.

提交回复
热议问题