Is there a way to look to see if a process is running for more than 3 hours. If it is running more than 3 hours, it should echo a simple failure message.
#identify process to kill
STARTDATE=`date -d +%s`
# Timelimit in seconds
TIMELIMIT = 10800
CDATE=`date -d +%s`
DIFF = CDATE - STARTDATE
while (proc_id exists)
if [[DIFF ge timelimit]]
# timelimit exceeded
kill proccess
fi
CDATE=`date -d +%s`
DIFF = CDATE - STARTDATE
end while