Cron jobs — to run every 5 seconds

前端 未结 6 683
轮回少年
轮回少年 2020-12-11 05:21

I want to create cron job that runs a script every 5 seconds. Seeing that cron jobs only allows increments of minutes 0-59 and so on.

I thought to create another scr

6条回答
  •  鱼传尺愫
    2020-12-11 05:40

    Try using anacron or, better yet, an init script to start when the computer starts.

    If you want the script to "restart itself", you'll need to run something every few minutes to check the original is still running. This can be done in inittab (/etc/inittab) or, on Ubuntu, /etc/event.d. Try man 5 inittab, looking at the 'respawn' option.

提交回复
热议问题