Cron jobs and holidays
James Knott
james.knott-bJEeYj9oJeDQT0dZR+AlfA at public.gmane.org
Thu Dec 14 23:17:39 UTC 2006
Neil Watson wrote:
> How would you ensure that a cron job was not run on a statutory holiday?
> My current thought was
>
> 4 4 * * 2-6 grep `date +%Y%m%d` /etc/holidays 1>/dev/null && my_script
>
> Using this method the holidays file is kept manually. Is there a more
> elegant and automatic way?
>
Well, given that stat holidays vary considerably with jurisdiction,
you'd need a list from somewhere. How else would your computer know
what the holidays are, where you live?
--
The Toronto Linux Users Group. Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists
More information about the Legacy
mailing list