From owner-freebsd-questions@FreeBSD.ORG Wed Oct 31 18:06:53 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 82D0A16A46B for ; Wed, 31 Oct 2007 18:06:53 +0000 (UTC) (envelope-from aharrison@gmail.com) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.179]) by mx1.freebsd.org (Postfix) with ESMTP id 3F41E13C4A6 for ; Wed, 31 Oct 2007 18:06:53 +0000 (UTC) (envelope-from aharrison@gmail.com) Received: by py-out-1112.google.com with SMTP id u77so460178pyb for ; Wed, 31 Oct 2007 11:06:33 -0700 (PDT) Received: by 10.64.209.6 with SMTP id h6mr1081466qbg.1193834353575; Wed, 31 Oct 2007 05:39:13 -0700 (PDT) Received: by 10.65.182.4 with HTTP; Wed, 31 Oct 2007 05:39:13 -0700 (PDT) Message-ID: Date: Wed, 31 Oct 2007 08:39:13 -0400 From: "Andy Harrison" To: FreeBSD-Questions In-Reply-To: <2cd0a0da0710310458t49610b34h9b19366c3765fe0@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <2cd0a0da0710310458t49610b34h9b19366c3765fe0@mail.gmail.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 18:06:53 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 10/31/07, VeeJay wrote: > I am running a status script written in Perl (*status.pl*) and want to have > it *Always Running*. > > > > How can I check through CRON that "status.pl" is running and if NO, then > start the script execution again? > Run monit. http://www.freshports.org/sysutils/monit/ Here's an example config for making sure sshd is running: $ cat /etc/monit.d/sshd check process sshd with pidfile /var/run/sshd.pid start program "/etc/init.d/sshd start" stop program "/etc/init.d/sshd stop" if failed port 22 protocol ssh then restart if 5 restarts within 5 cycles then timeout - -- Andy Harrison public key: 0x67518262 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) Comment: http://firegpg.tuxfamily.org iD8DBQFHKHeKNTm8fWdRgmIRAoZGAJ0ZJCzDedOEzVqJFYlniZshPKJmPwCaA8Uh pPYRFCDdrIk1YgYPcyH0hew= =dr1X -----END PGP SIGNATURE-----