From owner-freebsd-questions Wed Sep 13 23:49:20 2000 Delivered-To: freebsd-questions@freebsd.org Received: from ego.mind.net (ego.mind.net [206.99.66.9]) by hub.freebsd.org (Postfix) with ESMTP id DBD2537B424 for ; Wed, 13 Sep 2000 23:49:15 -0700 (PDT) Received: from takhus-home.ashlandfn.org (CascadeInvestmentCouncil3.ashlandfiber.net [208.46.219.24] (may be forged)) by ego.mind.net (8.9.3/8.9.3) with ESMTP id XAA24717; Wed, 13 Sep 2000 23:49:14 -0700 Received: from localhost (fleisher@localhost) by takhus-home.ashlandfn.org (8.11.0/8.11.0) with ESMTP id e8E6nBU03844; Wed, 13 Sep 2000 23:49:11 -0700 (PDT) (envelope-from takhus@takhus.mind.net) X-Authentication-Warning: takhus-home.ashlandfn.org: fleisher owned process doing -bs Date: Wed, 13 Sep 2000 23:49:11 -0700 (PDT) From: Tony Fleisher X-Sender: fleisher@takhus-home.ashlandfn.org To: Andre Albsmeier Cc: freebsd-questions@FreeBSD.ORG Subject: Re: crontab entry In-Reply-To: <20000914083428.A20675@curry.mchp.siemens.de> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, 14 Sep 2000, Andre Albsmeier wrote: > I am looking for a crontab entry that runs my command on > the first thursday of every month at 6 am. I thought the > following would work but it doesn't: > AFAIK, this cannot be done with a crontab entry. However, you may be able to wrap /path/to/my/command with a script that exits if the day of the month is greater than 7, and then use a crontab entry that simply specifies to run on every thursday. > 0 6 1-7 * 4 /path/to/my/command > > It was run today on the 14th which is not the first thursday :-) > From the crontab(5) manpage: Note: The day of a command's execution can be specified by two fields -- day of month, and day of week. If both fields are restricted (ie, aren't *), the command will be run when either field matches the current time. For example, ``30 4 1,15 * 5'' would cause a command to be run at 4:30 am on the 1st and 15th of each month, plus every Friday. Regards, TOny. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message