From owner-freebsd-hackers Sun Sep 16 18: 7:22 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from elvis.mu.org (elvis.mu.org [216.33.66.196]) by hub.freebsd.org (Postfix) with ESMTP id 092BF37B401; Sun, 16 Sep 2001 18:07:20 -0700 (PDT) Received: by elvis.mu.org (Postfix, from userid 1192) id C26E981D08; Sun, 16 Sep 2001 20:07:14 -0500 (CDT) Date: Sun, 16 Sep 2001 20:07:14 -0500 From: Alfred Perlstein To: Ben Smithurst Cc: Tim Allshorn , freebsd-hackers@freebsd.org Subject: Re: Cron pickle Message-ID: <20010916200714.X968@elvis.mu.org> References: <20010917014932.V43502@strontium.shef.vinosystems.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010917014932.V43502@strontium.shef.vinosystems.com>; from ben@FreeBSD.org on Mon, Sep 17, 2001 at 01:49:32AM +0100 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG * Ben Smithurst [010916 19:49] wrote: > Tim Allshorn wrote: > > > I know the cron command has to be something like : 59 23 ? ? * , with > > maybe some condition on the end. > > I think you could use something like > > 59 23 28-31 * * [ `date -v+1M +%d` -eq 1 ] && /path/to/your/program > > i.e., check that in one minute's time the day of the month is 1, if so, > run the program. I'm not a date(1) wizard, but there's a possible issue here, if the system is loaded cron may skip a beat possibly and that conditional may be delayed such that it doesn't trigger. My suggestion would be to use something more sophisticated such as a file someplace that tracks the last time it was run to make sure there's no race here. -- -Alfred Perlstein [alfred@freebsd.org] 'Instead of asking why a piece of software is using "1970s technology," start asking why software is ignoring 30 years of accumulated wisdom.' To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message