ps -eo comm,etime |
grep httpd |
ruby -ne 'sec, min, hour, day = $_.split(/ /).last.chomp.split(/[-:]/).reverse;
p day.to_i*24*60*60 + hour.to_i*60*60 + min.to_i*60 + sec.to_i' |
sort -nr |
head -n1
And without the whitespace, for ease of copy/pasting:
ps -eo comm,etime | grep httpd | ruby -ne 'sec, min, hour, day = $_.split(/ /).last.chomp.split(/[-:]/).reverse; p day.to_i*24*60*60 + hour.to_i*60*60 + min.to_i*60 + sec.to_i' | sort -nr | head -n1