Created
April 1, 2010 11:42
-
-
Save cklein/351708 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# cheyenne.sh - kill apache processes | |
# Created by Christian Klein on 2010-04-01. | |
# Copyright (c) 2010 HUDORA GmbH. All rights reserved. | |
ps -U www -o pid,time | tail +2 | while read pid time; do | |
hours=${time%:*} | |
minutes=${time#*:} | |
if [ $(printf %0.f $minutes) -gt 30 ] ; then | |
echo Kill apache $pid: $hours hours and $minutes minutes | |
kill -9 $pid | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment