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.
You can set a timeout after 2 hours and restart your javaScriptThatStalls 100 times this way in a loop
javaScriptThatStalls
seq 100|xargs -II timeout $((2 * 60 * 60)) javaScriptThatStalls