[ale] cron entry that runs the 2nd saturday of every month

Derek Atkins warlord at MIT.EDU
Mon Aug 29 11:25:02 EDT 2011


Geoffrey Myers <lists at serioustechnology.com> writes:

> Lightner, Jeff wrote:
>> I don't understand how %d and %u let you figure out that it is the
>> 2nd Saturday of the month.   You'd still have to do some calculation.
>
> Yes, but it's pretty straightforward calculation.  There's only a range 
> of days of the month that can be the 2nd Saturday of the month.

Right.  All you need to do is test for:

day == Saturday and
  day-of-month >= 8 and day-of-month <= 14

You can do the day == Saturday by cron, so you only need to test the
'day-of-month' is >= 8 and <= 14

-derek
-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available


More information about the Ale mailing list