-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 With ps you can display the start time of a process. The better way of doing it probably having your process write the start time to a file and have your check script compare the start time with current time. - -T - -----Original Message----- From: redhat-list-bounces@xxxxxxxxxx [mailto:redhat-list-bounces@xxxxxxxxxx] On Behalf Of Chris Sent: Wednesday, April 21, 2004 4:42 PM To: redhat-list@xxxxxxxxxx Subject: Detecting stuck process 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 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (MingW32) Comment: For info see http://www.gnupg.org iEYEARECAAYFAkCHFxAACgkQ5KDwTq1grf5EhwCglPku7kNEf6w17+hI9R0XhqnN /vMAn1U8tynQeQ9JJKxGeQ9M7FKT1lc7 =xYAp -----END PGP SIGNATURE----- -- redhat-list mailing list unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe https://www.redhat.com/mailman/listinfo/redhat-list