From owner-freebsd-questions@FreeBSD.ORG Tue Sep 2 16:03:54 2008 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 71DB310656A4 for ; Tue, 2 Sep 2008 16:03:54 +0000 (UTC) (envelope-from jas@pcjas.obspm.fr) Received: from blade2-ext.obspm.fr (blade2-ext.obspm.fr [145.238.186.8]) by mx1.freebsd.org (Postfix) with ESMTP id 0BB3E8FC20 for ; Tue, 2 Sep 2008 16:03:53 +0000 (UTC) (envelope-from jas@pcjas.obspm.fr) Received: from pcjas.obspm.fr (pcjas.obspm.fr [145.238.184.233]) by blade2-ext.obspm.fr (8.13.8/8.13.8/SIO Observatoire de Paris - 15/11/07) with ESMTP id m82G3p5F024673 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 2 Sep 2008 18:03:51 +0200 Received: from pcjas.obspm.fr (localhost [127.0.0.1]) by pcjas.obspm.fr (8.14.2/8.14.2) with ESMTP id m82G3p3a080294; Tue, 2 Sep 2008 18:03:51 +0200 (CEST) (envelope-from jas@pcjas.obspm.fr) Received: (from jas@localhost) by pcjas.obspm.fr (8.14.2/8.14.2/Submit) id m82G3p7S080293; Tue, 2 Sep 2008 18:03:51 +0200 (CEST) (envelope-from jas) Date: Tue, 2 Sep 2008 18:03:51 +0200 From: Albert Shih To: ElihuJ Message-ID: <20080902160351.GI79391@pcjas.obspm.fr> References: <19272656.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <19272656.post@talk.nabble.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.0 (blade2-ext.obspm.fr [145.238.186.20]); Tue, 02 Sep 2008 18:03:52 +0200 (CEST) X-Virus-Scanned: ClamAV 0.93.3/8140/Tue Sep 2 17:02:13 2008 on blade2-ext.obspm.fr X-Virus-Status: Clean Cc: freebsd-questions@freebsd.org Subject: Re: Cron Question X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Albert.Shih@obspm.fr List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Sep 2008 16:03:54 -0000 Le 02/09/2008 à 08:45:52-0700, ElihuJ a écrit > > Hi all. I have a question about cron jobs that seem to be running to long or > with multiple copies of itself. For example, I have a backup script that I > run that seems to make multiple copies of itself. If I view the running > processes I see numerous instances of the same cron job. Is there something > I can do to limit this from happening? When it does, it drains my CPU and > some of my other processes are non responsive. Any help would be > appreciated. Thank you. That's not the to cron to do that. You must put in your script some flags. For example if you using rsnapshot (in the ports) he put a lock file in /var/run (or what's ever you want) and don't start if the script find this file. When the script is end the file is erase. Something like if_the_lock_file_exit : exit 1 else touch lock_file my_script rm lock_file fi. Regards -- Albert SHIH SIO batiment 15 Observatoire de Paris Meudon 5 Place Jules Janssen 92195 Meudon Cedex Heure local/Local time: Mar 2 sep 2008 18:01:25 CEST