I have a script running in background like this:
nohup /tmp/a.sh &
If the script is running for more than 5 mins, I want to
-bash-3.2$ nohup /tmp/a.sh &  2518 -bash-3.2$ nohup: appending output to `nohup.out' -bash-3.2$ ps -ef | grep /tmp/a.sh ordev 2518 17827 0 15:24 pts/3 00:00:00 /bin/sh /tmp/a.sh ordev 2525 17827 0 15:24 pts/3 00:00:00 grep /tmp/a.sh -bash-3.2$ -bash-3.2$ killall /tmp/a.sh # killall not working like this /tmp/a.sh: no process killed
If I use
killall like below, it tries to kill all sessions running
-bash-3.2$ killall sh /tmp/a.sh sh(17822): Operation not permitted # this pid associated with another process under root user. /tmp/a.sh: no process killed + Terminated nohup /tmp/a.sh .
pkill -f, are there any alternatives that kill only the required script name?