* Matthew Seaman <[EMAIL PROTECTED]> [20030930 21:08]: wrote:
> 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)

How does that differ with the following?

23 11 * * 4     if [ `date +\%d` -le 7 ]; then /path/to/my/command; fi



 

        Best regards,
        Odhiambo Washington
        Wananchi Online Ltd.

----------------------------------+-----------------------------------------
 Odhiambo W. wash(at)wananchi(dot)com   . WANANCHI ONLINE LTD (Nairobi, KE)
 http://www.wananchi.com/email/         . 1ere Etage, Loita Hse, Loita St.,
 Mobile: (+254) 722 743 223             . # 10286, 00100 NAIROBI
----------------------------------+-----------------------------------------
What the hell, go ahead and put all your eggs in one basket.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


Do not be afraid of those who kill the body but cannot kill the soul.
Rather be afraid of the One who can destroy both soul and body in hell.
        Matthew 10:28
     

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to