Crimoney. One last thing:
When I need to do scheduled maybe-yes|maybe-no jobs with cron, I write
a script that decides whether or not it should run, and run it unconditionally
with cron.
For your application, I would use the following sequence:
set cron to run DoIt.script at 17:30 from the 1st to the 7th
set cron to run DoIt.script at 18:30 Monday thru Friday.
The script can signal itself not to run at 18:30 by touching a file on the first
weekday of the month.
What it would then do is (using an external program, maybe) get the required
date info and:
If it’s a holiday, exit
If it’s not a weekday, exit
If it finds a “signal” (say, a particular file) clear the signal and exit
Otherwise, run.
The tricky part is when they ask you to make it run one hour earlier on
the first non-holiday weekday of the month, unless it’s February and the
last two digits of the year are a prime number … but you can extend
the logic in the script for that. Just don’t try to get too fancy
with cron (sorry, Jim) it’s almost always a bad idea.
In other posts, I’ve mentioned that Timezones are a pain. I should’ve
mentioned that dates are also a pain. Time, in general, is a pain. In fact,
“Time is an illusion. Lunchtime, doubly so.”
–Ford Prefect