Cron jobs and holidays

Lennart Sorensen lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys at public.gmane.org
Thu Dec 14 19:15:41 UTC 2006


On Thu, Dec 14, 2006 at 01:53:57PM -0500, 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?

grep -q is more elegant than 1>/dev/null :)

--
Len Sorensen
--
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