Kill process after a given time bash?

后端 未结 5 1628
被撕碎了的回忆
被撕碎了的回忆 2021-02-01 03:23

I have a script that tries to make a DB connection using another program and the timeout(2.5min) of the program is to long. I want to add this functionality to the script.

5条回答
  •  隐瞒了意图╮
    2021-02-01 04:05

    You can set a timeout after 2 hours and restart your javaScriptThatStalls 100 times this way in a loop

    seq 100|xargs -II timeout $((2 * 60 * 60)) javaScriptThatStalls
    

提交回复
热议问题