Skip to content

Instantly share code, notes, and snippets.

@cklein
Created April 1, 2010 11:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cklein/351708 to your computer and use it in GitHub Desktop.
Save cklein/351708 to your computer and use it in GitHub Desktop.
#!/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