From owner-freebsd-hackers Tue Apr 15 16:49:08 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id QAA21031 for hackers-outgoing; Tue, 15 Apr 1997 16:49:08 -0700 (PDT) Received: from boulder.syr.servtech.com (boulder.syr.servtech.com [206.106.144.94]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id QAA21016 for ; Tue, 15 Apr 1997 16:49:01 -0700 (PDT) Received: from boulder.syr.servtech.com (localhost [127.0.0.1]) by boulder.syr.servtech.com (8.8.5/8.8.5) with SMTP id TAA01770; Tue, 15 Apr 1997 19:50:24 -0400 (EDT) Message-ID: <3354143F.41C67EA6@servtech.com> Date: Tue, 15 Apr 1997 19:50:23 -0400 From: Shawn Carey X-Mailer: Mozilla 3.0 (X11; I; FreeBSD 2.2.1-RELEASE i386) MIME-Version: 1.0 To: "Daniel O'Callaghan" CC: freebsd-hackers@freebsd.org Subject: Re: crontab question References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Daniel O'Callaghan wrote: > > On Tue, 15 Apr 1997 smc@servtech.com wrote: > > > What I'd like to do is set up a cron task that runs on either the first > > or last Sunday of every month. As an experiment, I've got: > > > > 0 14 * * 0/4 root mail -s "cron test" root > > > > This seems to be frustratingly close, but it leaves me guessing which > > Sunday it will run on, and it hasn't been in long enough to run yet. > > Which do you *want* it to run on? > > 0 14 1-7 * 0 root mail -s "cron test" root > will run on the first Sunday. > [...] But won't it run every day of the first week, and every Sunday after that also? Only one of the two day fields needs to match in order for cron to run the command. Since I'll be using this to automate monthly backups, I'd rather not accidentally chew on tapes that happen to be in the drives at an unlucky moment! :-) It seems to me that what I need is for cron to logically AND the day-of-week and day-of-month fields instead of using logical OR. Is there any low down, dirty way to simulate this (short of hacking cron)? Thanks, -Shawn Carey