From owner-freebsd-hackers Sun Sep 16 19:17:39 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.gbch.net (gw.gbch.net [203.24.22.66]) by hub.freebsd.org (Postfix) with SMTP id 7CB5637B40E for ; Sun, 16 Sep 2001 19:17:33 -0700 (PDT) Received: (qmail 89980 invoked by uid 1001); 17 Sep 2001 12:17:30 +1000 Message-ID: X-Posted-By: GJB-Post 2.21 16-Jun-2001 X-Operating-System: FreeBSD 4.2-RELEASE i386 X-Location: Brisbane, Australia; 27.49841S 152.98439E X-URL: http://www.gbch.net/gjb.html X-Image-URL: http://www.gbch.net/gjb/gjb-auug048.gif X-GPG-Fingerprint: EBB2 2A92 A79D 1533 AC00 3C46 5D83 B6FB 4B04 B7D6 X-PGP-Public-Keys: http://www.gbch.net/keys.html Date: Mon, 17 Sep 2001 12:17:30 +1000 From: Greg Black To: Tim Allshorn Cc: freebsd-hackers@freebsd.org Subject: Re: Cron pickle References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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 Tim Allshorn 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. If you are working for somebody irrational who thinks he needs something done on the last minute of each month, you'll have to run it at 23:59 on days 28-31 every month and have the program determine for itself if this is the last day of this month this year. For those who think it can be done with multiple entries, you have forgotten that one month has a variable number of days and cron has no concept of years -- so you can't specify the right thing for the last day of February in a crontab file. And if you don't care about the leap year case for February, then you can't possibly care if the job is run on the zeroth minute of the first of the month, and that's easy to specify. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message