From owner-freebsd-questions@FreeBSD.ORG Wed Oct 31 13:52:55 2007 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 9539E16A418 for ; Wed, 31 Oct 2007 13:52:55 +0000 (UTC) (envelope-from mike.jeays@rogers.com) Received: from smtp103.rog.mail.re2.yahoo.com (smtp103.rog.mail.re2.yahoo.com [206.190.36.81]) by mx1.freebsd.org (Postfix) with SMTP id 2D5FF13C4B6 for ; Wed, 31 Oct 2007 13:52:55 +0000 (UTC) (envelope-from mike.jeays@rogers.com) Received: (qmail 88503 invoked from network); 31 Oct 2007 12:52:11 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=rogers.com; h=Received:X-YMail-OSG:From:To:Subject:Date:User-Agent:References:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-Disposition:Message-Id; b=ScDYLjZ/2P993CfXOPBVgfwO28L77Q9Icc8PjEMWuMIj6m04a2jxeJDHhI2yCb/QfhJy+wLDfnjzI5QyQ3RoKcR4/i+p2wxObkHrzFMOSHgAUA1aU8Y5riSKhfNv8JHeNDOrGpv19xx5/wInuWxE9cUqQlZVQJ29m4bTXal0Cj4= ; Received: from unknown (HELO napoleon.local) (mike.jeays@rogers.com@99.224.73.40 with login) by smtp103.rog.mail.re2.yahoo.com with SMTP; 31 Oct 2007 12:52:11 -0000 X-YMail-OSG: JrnDR_kVM1m1_2XKjI07hGP89MqmluH2uWQKTLCZdtlr7ZQzTK4pf4HqSHg9duw9jQ-- From: Mike Jeays To: freebsd-questions@freebsd.org Date: Wed, 31 Oct 2007 08:52:20 -0400 User-Agent: KMail/1.9.6 (enterprise 0.20070907.709405) References: <2cd0a0da0710310458t49610b34h9b19366c3765fe0@mail.gmail.com> In-Reply-To: <2cd0a0da0710310458t49610b34h9b19366c3765fe0@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200710310852.20319.mike.jeays@rogers.com> Subject: Re: Help with Cron pleazzzzzzzzzzzz 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: Wed, 31 Oct 2007 13:52:55 -0000 On October 31, 2007 07:58:21 am VeeJay wrote: > Hello Gurus=85. > > > > I am running a status script written in Perl (*status.pl*) and want to ha= ve > it *Always Running*. > > > > How can I check through CRON that "status.pl" is running and if NO, then > start the script execution again? > > > > Please help and advise=85 > > > > With a bundle of thanks! You could write a shell script something like: #!/bin/bash ps -ax | grep 'status.pl' if [ $q -eq 0 ] then status.pl fi grep will return zero if it finds a line containing 'status.pl', and 1=20 otherwise. in crontab, use * * * * * /full/path/to/script-above and it will check every minute. But a better fix would be to find the bug in status.pl that makes it crash! =2D-=20 Mike Jeays http://www.jeays.ca