From owner-freebsd-hackers Sun Sep 16 20: 0: 8 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from www.svzserv.kemerovo.su (www.svzserv.kemerovo.su [213.184.65.80]) by hub.freebsd.org (Postfix) with ESMTP id 27B6937B405 for ; Sun, 16 Sep 2001 20:00:04 -0700 (PDT) Received: (from root@localhost) by www.svzserv.kemerovo.su (8.9.3/8.9.3) id KAA07166; Mon, 17 Sep 2001 10:59:32 +0800 (KRAST) (envelope-from eu) Date: Mon, 17 Sep 2001 10:59:32 +0800 From: Eugene Grosbein To: Greg Black Cc: Tim Allshorn , freebsd-hackers@freebsd.org Subject: Re: Cron pickle Message-ID: <20010917105932.A5338@svzserv.kemerovo.su> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from gjb@gbch.net on Mon, Sep 17, 2001 at 12:17:30PM +1000 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 On Mon, Sep 17, 2001 at 12:17:30PM +1000, Greg Black wrote: > | I need to be able to run a particular program at the last > | minute of each month and yes I know it would be much easier to > | run it at the first minute of each month, but my hands are tied > | and my brain is too puny to work it out. > > This cannot be done with cron, even with multiple entries. You > can use cron to schedule something for minute zero of each month > and that should be good enough for any reasonable use. This can be done with cron with single entry and small overhead. Run whis script at last minute of every day (or every 28-31): #!/bin/sh tomorrow=`date -v+1d %d` if [ $tomorroq -ne "01" ]; then exit # if tomorrow is not begin of month, do nothing fi # do work now ... Eugene Grosbein To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message