[sclug] cronicles

Tom Dawes-Gamble tmdg at tmdg.co.uk
Tue Feb 8 15:20:19 UTC 2005


On Tue, 2005-02-08 at 14:09 +0000, Simon Heywood wrote:
> On Tue,  8 Feb 2005 at 10:00:02 +0000, Simon Heywood wrote:
> > The next meeting of the SCLUG will be at the Back of Beyond pub in 
> > King's Road, Reading, at 19:30 this Wednesday.
> 
> Sorry, that would be me not reading crontab(5) properly:
> 
> # Send the SCLUG meeting reminder on the Monday before the
> # second Wednesday of each month at 10:00.
> 0 10 6-12 * 1  $HOME/bin/sclug-reminder
> 
> Am I right in thinking that this can't be done directly with cron?
> 

Hi Simon,

Correct you need to add some tests.  

Your cron there says,   Run on the 6,7,8,9,10,11 and 12th of the month
AND every Monday.

I used to run the cron job every Sunday it on and did the following
test.

#! /bin/sh

today=$(date +%d)
today=${today#0}  

if (( $today < 5  ))
then
        exit;
fi
if (( $today > 11 ))
then
        exit
fi

(( nextmeet = today + 3 ))

mon=$(date +"%B %Y")

mail -s "SCLUG Meeting this Wednesday $nextmeet $mon at 19:30"
sclug at sclug.org.uk  << EOF

Tom.



More information about the Sclug mailing list