Hi,
You could try something like;
Code:
#!/bin/bash
ps -ef > .psef
SIZE=$((`cat .temprocs |wc -l |sed 's?[^0-9]??g'` - 1))
cat .temprocs | tail -$SIZE |awk '{print $2 " since " $5}' | grep -v "[0-9]\{2\}.[0-9]\{2\}" > .temprocs
rm -r .psef
that will give you everything over a day old (at least it does on my SuSE box). Some clever grep/sed/sort-ing could isolate procs started over a week ago. That method won't isolate idle processes though...
Maybe a nightly cron which loops through procs and straces them?
Still automated kills fill me with dread! Personally I'd just look though a 'ps -ef' every couple of days!