On Thu, 2004-11-04 at 18:39, Jamie Wilkinson wrote: > This one time, at band camp, Peter Hardy wrote: > >I know this could be condensed to one line like > > > >30 10 * * * ( wday -q || wday -q `/bin/date -d yesterday +%Y%m%d` ) && > >/path/to/script > > > >, I just thought splitting across two lines would be more readable. :-) > > Actually, the two line version is correct, and the one line version isn't: > your script will run every day. > > But, change the last * to 1,2 and I think you'll be right. cron even lets > you use "mon,tue", I think.
Actually, I think you've got it the wrong way around. The one line version works for today. [EMAIL PROTECTED]:~$ ( wday -q || wday -q `/bin/date -d yesterday +%Y%m%d` ) && echo Hello [EMAIL PROTECTED]:~$ But it seems to fail when both days being checked are public holidays. For this coming Sunday the 7th: [EMAIL PROTECTED]:~$ ( wday -q 20041107 || wday -q 20041106 ) && echo Hello Hello [EMAIL PROTECTED]:~$ And for the Christmas public holiday on Monday the 27th of December: [EMAIL PROTECTED]:~$ ( wday -q 20041227 || wday -q 20041226 ) && echo Hello Hello [EMAIL PROTECTED]:~$ Only running on mon,tue won't help at all, because it'll still run the script on Mondays of long weekends. I guess that'll teach me for posting untested script fragments to mailing lists. :-) Cheers, -- Pete -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html