AIX: Find a process older than 15days

Hi All,

My application has specific processes when the developers start using respective GUI . I would like to find related process on server side that is older than 15 days for my application.
I am using AIX 6.0. Could you please help with the command on how to find the older process?

Thank you.

Use the ps command. It has a column where the time elapsed since start is displayed. You can also specify a custom format with -o to display only those status infos you need. That as a start. More info is in the man pages of this command. The rest can be achived with for example grep and if/then/fi etc...

Thank you for the response. I did read the man page for ps and tried to execute the following command.
ps -o user,pid,etime | grep dsap and this did not result in any output. But I do see the related processes are running. Sample command would be really helpful. Thank you.

ps -eo user,pid,etime | grep dsap 

ps -e looks at ALL processes.

Will it work for you?

 
MYDP=2 ## Days elapsed
 
ps -eo etime,uid,pid,comm | awk -v x=$MYDP -F'-' '{if($1 > x) print $0}' | awk '{print $4}'
 

Thank you all for your response. This works for me.

-Chandra