Detecting stuck process

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



How can I test, in a bash script, to see whether there is a
process running for say more than 30 seconds, and if so then
execute appropriate action?

I currently have a cron job that runs every X minutes that
runs a script (which restarts the stuck process), but
technically I only need to run this script if a certain
process gets stuck.  How can I pull the info from 'top' and
see if it's more than 30 seconds in the TIME column, and
only then run the rest of my script?

Thanks,

Chris


-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux