mirror of https://github.com/apache/archiva.git
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
This commit is contained in:
parent
eb7d25d8e1
commit
9fdd8b4d26
|
@ -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);
|
||||
}
|
||||
}
|
||||
}'
|
Loading…
Reference in New Issue