From owner-freebsd-questions@FreeBSD.ORG Wed Feb 3 15:49:12 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F03E10656C1 for ; Wed, 3 Feb 2010 15:49:12 +0000 (UTC) (envelope-from freebsd-questions-local@be-well.ilk.org) Received: from mail4.sea5.speakeasy.net (mail4.sea5.speakeasy.net [69.17.117.6]) by mx1.freebsd.org (Postfix) with ESMTP id 2A68B8FC13 for ; Wed, 3 Feb 2010 15:49:11 +0000 (UTC) Received: (qmail 18285 invoked from network); 3 Feb 2010 15:49:11 -0000 Received: from dsl092-078-145.bos1.dsl.speakeasy.net (HELO be-well.ilk.org) ([66.92.78.145]) (envelope-sender ) by mail4.sea5.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 3 Feb 2010 15:49:11 -0000 Received: by be-well.ilk.org (Postfix, from userid 1147) id AFAC75082E; Wed, 3 Feb 2010 10:49:10 -0500 (EST) From: Lowell Gilbert To: Nadir Aliyev References: <85d1584578da54a48257f998b89fd337@localhost> Date: Wed, 03 Feb 2010 10:49:10 -0500 In-Reply-To: <85d1584578da54a48257f998b89fd337@localhost> (Nadir Aliyev's message of "Tue, 02 Feb 2010 12:48:40 +0400") Message-ID: <44bpg6qpzd.fsf@be-well.ilk.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: freebsd-questions@freebsd.org Subject: Re: crontab X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-questions@freebsd.org List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Feb 2010 15:49:12 -0000 Nadir Aliyev writes: > Hello friends. > > I have interesting situation with cron. > > I created a > simple script for process monitoring: > > #!/usr/local/bin/bash > processname=`/bin/ps aux | /usr/bin/grep -v grep | > /usr/bin/grep -c 'maintenance_jobs.php'` > if [ $processname -le "0" ]; > then > echo "`/bin/date` > JOB WAS DEAD. RESTARTED!" | mail -s "ATTENTION" > my@email.net; > /usr/local/bin/php > /usr/local/www/web/bin/maintenance_jobs.php then" is not interpretated by > shell when i run this script from cron. > > I tried it on sh and bash. Result > is same. > But this script worked on pre 8 versions. The script got wrapped and apparently cut off. I can't understand it, and probably nobody else could either. -- Lowell Gilbert, embedded/networking software engineer, Boston area http://be-well.ilk.org/~lowell/