Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

bash maximum running time

timeout -s ${kill_signal} --preserve-status ${maxrun} /root/mon-lastdata.sh

example:
timeout -s 9 --preserve-status 100 /root/mon-lastdata.sh

-s 9 is equivalent to kill -9
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #bash #maximum #running #time
ADD COMMENT
Topic
Name
1+1 =