Cron jobs and holidays

Scott C. Ripley scott-VK/PCEBaDz+N9aS15agKxg at public.gmane.org
Fri Dec 15 14:05:17 UTC 2006


of course perl has some handy modules:
   http://search.cpan.org/search?m=all&q=holiday&s=1

Date::Manip
   http://search.cpan.org/~sbeck/DateManip-5.44/Manip.pod#HOLIDAY_SECTION

would allow you to use a nomenclature for describing holidays, you 
would be able to minimize the amount of (year-to-year) maintenance 
required for your holiday file... (i.e. rather than grep, make simple 
script using this module to return true/false depending on date passed 
in & config file of holidays for your geographic region)




On Thu, 14 Dec 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?
>
>

-- 

Gold For Sale (e-mail me for info!)

-----
Scott C. Ripley
phone: (416)738-6357
www: http://www.scottripley.com
email: scott-VK/PCEBaDz+N9aS15agKxg at public.gmane.org

Secure Your E-Mail!
   http://www.mysecuremail.com/javascrypt/
--
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