Need to kill processes that are older than 3 days

Hi, I need a .ksh script that lists all the process that are currently running and older than 3 days. once the process list is available i need to mail the list and then kill those processes.

Quick response is highly appreciated :b:

Thanks in Advance!!!
Sri

can you give us an understanding of why you need this??

many of the core OS PID's will be more than three days old....

and also what OS ??

There are no on-the-fly commands to do this:

We can go with a logic as ... if a pid is older than 24 hrs, it will be displayed in Mon hr format..

eg: Jun 09

Try the below snippet to take only those pids which are older than 24 hrs. You can put in your logic on top of the snippet given below to look for pids older than "n" days

ps -ef| sed '/\([JFMAMSOND][aepuco][nbrylgptvc] [0-9][0-9]\)/!d' | awk '{ print $2" "$5":"$6; }'

Thanks Guys, let me clarify the things i need here. I have few process scheduled to run everyday. if by chance any process doesn,t complete within 3 days i need to kill them. ps list will be very big so i may miss few process while manually checking.
I do not want to kill any sys process. i just want to generate list of all the .ksh jobs and its child ps that are older than 3 days. later looking at that list i will decide what to kill. (it will be easy to look into the list which will have only 3 days older ps)
And My OS is Hp-Ux.