Process Uptime

Hi,

I need some help about a script i need to write.

I want to check , if some specific process, are running since 2 hours.

I tried to use a loop , grep my pid and use find -ctime on /proc directory, to list what i need.

for i in `ps -ef |grep process |grep -v grep|awk '{print $2}'`
find /proc -name $i -ctime ...

Can i use ctime for hours ?
Do you know if there is a better way to do that script?

Thanks for your help

Always do a search before you ask a question. This is a good start:

Cheers,

Keith

Does you ps have formatting so that you can have it print only the pid and the total running time? E.g.

ps -eo%p%t|awk '/ 02:/{print $1}'