Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Sep 2000 23:49:11 -0700 (PDT)
From:      Tony Fleisher <takhus@takhus.mind.net>
To:        Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: crontab entry
Message-ID:  <Pine.BSF.4.21.0009132343090.3824-100000@takhus-home.ashlandfn.org>
In-Reply-To: <20000914083428.A20675@curry.mchp.siemens.de>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0009132343090.3824-100000>