Check process

Hi..
I have this code which tells me that if a process is running or not. Actually someone on this forum help me to do it. :slight_smile: But now If i want to check if the process is not running for more than 10 minutes. Does anyone know the code or syntax that checks if a process is not running for some amount of time? Please help me.

#!/bin/bash
#check_procs returns "OK:  process running" if the process is running and "not running: process not running"
 
check=$"/usr/local/check_procs myprocess"
var="not runnig: myprocess not running"
 
if [ $check = $var ]; then 
   echo "not running"
else 
  echo "runnig"
fi

Thanks

Try to call this script in some timer every once in a while and see if the process in running or not and get the timestamp( ) whenever you check.. the difference should get you the time whether the process was running or not...