diff options
author | Carlos Sanchez Gonzalez <carlos@apache.org> | 2007-07-11 19:59:53 +0000 |
---|---|---|
committer | Carlos Sanchez Gonzalez <carlos@apache.org> | 2007-07-11 19:59:53 +0000 |
commit | 9fdd8b4d268a281a6e621487d2529852a3313bc6 (patch) | |
tree | 76382a1cd28cad294b4d03df95517e3c39216e22 /maven-meeper | |
parent | eb7d25d8e1c20cba136716b3e97b58ee7a648ccd (diff) | |
download | archiva-9fdd8b4d268a281a6e621487d2529852a3313bc6.tar.gz archiva-9fdd8b4d268a281a6e621487d2529852a3313bc6.zip |
Add a script to kill long running projects for stalled rsyncs
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@555381 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'maven-meeper')
-rwxr-xr-x | maven-meeper/src/bin/kill_long_runners.sh | 22 |
1 files changed, 22 insertions, 0 deletions
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: <scriptname> <process name> <timeout in hours> +## + + + 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); + } + } +}' |