View Single Post

   
  #1 (permalink)  
Old 01-05-2008, 09:15 AM
BD
 
Posts: n/a
Default QUESTION: Crontab syntax for "Second Sunday in a month"

Hi, all.

I'm on AIX 5.2.0.2

I have been tasked with running a series of 3 scripts once a month, on
_different_ Sundays.

So the first script will be run on the first Sunday, the second one the
second Sunday, etc.

The first thing I tried was:

00 01 1-7 * 0

And it ran this morning, which is Day 5 (thursday).

I have subsequently discovered that if the DOW and DOM are both
specified, they are "OR-ed" rather than being "AND-ed". Hence the
scheduled task running this morning.

I have read various posts about this - one fellow says: "The only way
around this is to complicate the scripts by using cron to specify one
of the selection criteria and testing for the other criterion
_in_the_script_."

This strikes me as just plain silly.

Are there no other cron-specific ways of addressing this requirement?
Does that 'OR-ing of the DOM and DOW strike anyone else as counter to
what a cron entry 'should' do?

Thanks for all input!

BD.

Reply With Quote