Re: [Nolug] Bash backup script help

From: -ray <ray_at_ops.selu.edu>
Date: Mon, 25 Jun 2007 07:55:54 -0500 (CDT)
Message-ID: <Pine.LNX.4.61.0706250749410.1361@romulus.csd.selu.edu>

On Sat, 23 Jun 2007, B. Estrade wrote:

> if [ -n `ps -auxw | grep name_of_exe` ]; then

Be careful with this, as the "grep name_of_exe" will also show up in the
ps output, so this statement would always be true. You need to exclude
"grep" from ps output:

> if [ -n `ps -auxw | grep -v grep | grep name_of_exe` ]; then

Someone also mentioned pgrep. Redhat/Fedora also has /sbin/pidof. pgrep
is probably more standard though (at least on Linux/Solaris).

ray

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Ray DeJean  				       	 http://www.r-a-y.org
Systems Engineer                    Southeastern Louisiana University
IBM Certified Specialist  	      AIX Administration, AIX Support
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
___________________
Nolug mailing list
nolug@nolug.org
Received on 06/25/07

This archive was generated by hypermail 2.2.0 : 12/19/08 EST