I meant old not hold
I need to kill a process if it's over an hour old and then send an e-mail of the list that was killed.....?
I need to kill ps -ef | grep stashd | grep ' older than an hour?'
#! /bin/bash
if test ps -ef | grep <stashd> (Is over an hour old)???? >>stashd_old.txt
stashd_old=`cat stashd_old.txt`
for i in $stashd_old;
do
kill -9 <stashd>
echo "Found <process_name> older than 1 hour, and killed process name | mail -s "killed <process_name `date`" Jay
fi
done;
etc this stashd process if it's over an hour old?