You might, like me, once have tried to get something to run on the first Monday of the month, or maybe the last Friday of the month, or something else that’s a combination of a weekday (Mon–Sun) and a «week» (i.e. a date range, like 01–07). The naive approach is to use cron as you would expect it to work:
0 0 1-7 * 1 /usr/bin/foo
The surprise comes when this makes foo
... [continue reading]