[TriLUG] correction: process monitoring
Jon Carnes
jonc at nc.rr.com
Sat Jan 18 10:42:44 EST 2003
I like to use:
if ( `ps -C $PROC |grep -q $PROC` ); then echo $PROC is running; fi
Doesn't use any temp files.
On Fri, 2003-01-17 at 23:14, Michael Mueller wrote:
> Added --no-header option below.
>
> I want to monitor the existance of a process. All I ever know is the name of
> the process. I came up with the following:
>
> $ ps -C process_cmd_name --no-header > temp
> $ ls -l temp
>
> if temp size is 0 then process does not exist else it does exist
>
> I was going to use the getsize function in the os.path module in Python for
> the ls function above.
>
> Anybody think of another way to accomplish this?
>
> Thanks
> --
> Mike M.
>
> _______________________________________________
> TriLUG mailing list
> http://www.trilug.org/mailman/listinfo/trilug
> TriLUG Organizational FAQ:
> http://www.trilug.org/~lovelace/faq/TriLUG-faq.html
More information about the TriLUG
mailing list