Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Nov 2002 19:51:09 +0100
From:      Len Conrad <LConrad@Go2France.com>
To:        freebsd-questions@freebsd.org
Subject:   .sh interactive ok, from crontab, not
Message-ID:  <5.1.1.6.2.20021124194251.02c390c0@mail.go2france.com>

next in thread | raw e-mail | index | archive | help
Trying to write a little watch-dog/keep-alive script for a couple of 
related daemons, an MTA and an SMTP AV scanner.

This snippet works fine...

if ( ps aux | grep -i "^root.*master" ) > /dev/null
then
echo "then: exit code equal 0"
exit 0
else
<try to run the daemon>

... when run from the command line, the echo text displays. But, when run 
from crontab every 10 minutes, the if fails, and the else clause runs.

I've tried every syntax I know, but still can't get this logic to work.

Upstream in the same script, there is another "if" with same syntax that 
also checks a related daemon, and that IF works as expected, both 
interactively and from crontab.

suggestions?

Len


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5.1.1.6.2.20021124194251.02c390c0>