From owner-freebsd-questions Sun Nov 24 10:52: 5 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 988B837B401 for ; Sun, 24 Nov 2002 10:52:04 -0800 (PST) Received: from mgw1-out.MEIway.com (mgw1.meiway.com [212.73.210.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5A4FB43EA9 for ; Sun, 24 Nov 2002 10:52:03 -0800 (PST) (envelope-from LConrad@Go2France.com) Received: from VirusGate.MEIway.com (virus-gate.meiway.com [212.73.210.91]) by mgw1-out.MEIway.com (Postfix Relay Hub) with ESMTP id 8B3B2EF6A5 for ; Sun, 24 Nov 2002 19:51:53 +0100 (CET) Received: from localhost (localhost.meiway.com [127.0.0.1]) by VirusGate.MEIway.com (Postfix) with SMTP id 9E5DE5D009 for ; Sun, 24 Nov 2002 19:51:59 +0100 (CET) Received: from mail.Go2France.com (ms1.meiway.com [212.73.210.73]) by VirusGate.MEIway.com (Postfix) with ESMTP id 34EC05D008 for ; Sun, 24 Nov 2002 19:51:59 +0100 (CET) Received: from tx0-go2france-c.Go2France.com [193.252.44.38] by mail.Go2France.com with ESMTP (SMTPD32-6.06) id A25143AD0236; Sun, 24 Nov 2002 20:02:41 +0100 Message-Id: <5.1.1.6.2.20021124194251.02c390c0@mail.go2france.com> X-Sender: LConrad@Go2France.com@mail.go2france.com X-Mailer: QUALCOMM Windows Eudora Version 5.1.1 Date: Sun, 24 Nov 2002 19:51:09 +0100 To: freebsd-questions@freebsd.org From: Len Conrad Subject: .sh interactive ok, from crontab, not Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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 ... 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