Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- LIMIT="1800" ; ps aux | grep cli.php | awk '{print $2}' | while read PID ; do UPTIME=$(awk -v ticks="$(getconf CLK_TCK)" 'NR==1 { now=$1; next } { print int(now - ($22/ticks)) }' /proc/uptime /proc/$PID/stat 2>/dev/null) ; if [ ! -z "$UPTIME" ] && [ "$UPTIME" -ge "$LIMIT" ] ; then echo "$PID is now killing" ; kill -9 $PID ; fi ; done > /dev/null 2>&1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement