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

前端 未结 9 582
佛祖请我去吃肉
佛祖请我去吃肉 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 20:11

    If you insist of running your script from cron:

    * * * * * /foo/bar/your_script
    * * * * * sleep 15; /foo/bar/your_script
    * * * * * sleep 30; /foo/bar/your_script
    * * * * * sleep 45; /foo/bar/your_script
    

    and replace your script name&path to /foo/bar/your_script

提交回复
热议问题