Running a cron every 30 seconds

后端 未结 19 1263
面向向阳花
面向向阳花 2020-11-22 10:56

Ok so I have a cron that I need to run every 30 seconds.

Here is what I have:

*/30 * * * * /bin/bash -l -c \'cd /srv/last_song/releases/2012030813315         


        
19条回答
  •  傲寒
    傲寒 (楼主)
    2020-11-22 11:34

    Currently i'm using the below method. Works with no issues.

    * * * * * /bin/bash -c ' for i in {1..X}; do YOUR_COMMANDS ; sleep Y ; done '
    

    If you want to run every N seconds then X will be 60/N and Y will be N.

提交回复
热议问题