On Tue, Sep 30, 2003 at 07:49:57PM +0300, Odhiambo Washington wrote:
> This question was asked and was answered by Crist J. Clark some years gone.
> Google could not help me so I beg to ask here:

crontab(5) should be all you need.
> I would like to run a script via crontab every
> 1. 3rd day and 28th day of each month (seems easy)

Crontab line like:

  23 11 3,28 * * your_script

will run at 11:23am on the 3rd and 28th of each month.

> 2. Every first Thursday of the month

This one is slightly trickier -- the best you can do with crontab is
either every Thursday, and add logic to your script to detect if it's
on or before the 7th of the month (or conversely for the first 7 days
of each month, and have the script check if it's Thursday): something
like --

  23 11 * * Thu   [ $(date +%d) -lt 8 ] && your_script

( or

  23 11 1-7 * *   [ $(date +%a) = "Thu" ] && your_script

but the former is probably preferable)



Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey         Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to