diff --git a/maven-meeper/src/bin/kill_long_runners.sh b/maven-meeper/src/bin/kill_long_runners.sh new file mode 100755 index 000000000..b4ba23696 --- /dev/null +++ b/maven-meeper/src/bin/kill_long_runners.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +## +##Usage: +## + + + ps -eo comm,etime,pid | + grep $1| + awk -v TIMEOUT=4 ' +{ + if($2~/-/){ + system("kill -9 "$3); + } + else{ + tl=split($2, tm, ":"); + print tl; + if(tl==3 && tm[1]>TIMEOUT){ + system("kill -9 "$3); + } + } +}'