Ignacio suggested something similar in your crontab:
31 1 * * * [ -f /var/run/cron-holiday ] || /usr/local/bin/whatever-command
then at the beginning of the weekend, as root:
and on monday:
This is good and simple, but it has a drawback: if you forget to delete the file, your red-scripts will never run again, which may be bad.
An alternative is to have a file specifying the vacation dates and do something like this:
31 1 * * * grep -q `date -I` /etc/cron-holidays || whatever-command-here
where the file / etc / cron -holidays contains lines like
2011-04-01 2011-12-25
etc.
poolie
source share