From owner-freebsd-questions@FreeBSD.ORG Tue Feb 2 11:54: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 07BE2106566B for ; Tue, 2 Feb 2010 11:54:12 +0000 (UTC) (envelope-from nadir@ultel.net) Received: from mail.ultel.net (mail.ultel.net [81.21.80.20]) by mx1.freebsd.org (Postfix) with ESMTP id A4EF78FC0C for ; Tue, 2 Feb 2010 11:54:11 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.ultel.net (Postfix) with ESMTP id 3B07F78C9F for ; Tue, 2 Feb 2010 12:48:44 +0400 (AZT) X-Virus-Scanned: amavisd-new at ultel.net Received: from mail.ultel.net ([127.0.0.1]) by localhost (ns2.ultel.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iXkTDYxmhRCl for ; Tue, 2 Feb 2010 12:48:40 +0400 (AZT) Received: from roundcube (localhost [127.0.0.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.ultel.net (Postfix) with ESMTPS id B715678C9B for ; Tue, 2 Feb 2010 12:48:40 +0400 (AZT) MIME-Version: 1.0 Date: Tue, 02 Feb 2010 12:48:40 +0400 From: Nadir Aliyev To: Organization: ULTEL Message-ID: <85d1584578da54a48257f998b89fd337@localhost> X-Sender: nadir@ultel.net User-Agent: RoundCube Webmail/0.3.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: crontab X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Feb 2010 11:54:12 -0000 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.