<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Make cron skip holidays? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/make-cron-skip-holidays/m-p/2794346#M80588</link>
    <description>Well Bob, you could do a date '%j' and parse the /etc/acct/holidays file yourself but why bother. &lt;BR /&gt;&lt;BR /&gt;This is much simpler:&lt;BR /&gt;&lt;BR /&gt;if [[ $(caljd.sh) -ne $(caljd.sh -h) ]]&lt;BR /&gt;  then&lt;BR /&gt;    echo "Today is a holiday."&lt;BR /&gt;  fi&lt;BR /&gt;&lt;BR /&gt;Pretty simple.&lt;BR /&gt;&lt;BR /&gt;Here's the required script. Just make sure that caljd.sh is in your PATH.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Mon, 26 Aug 2002 19:07:29 GMT</pubDate>
    <dc:creator>A. Clay Stephenson</dc:creator>
    <dc:date>2002-08-26T19:07:29Z</dc:date>
    <item>
      <title>Make cron skip holidays?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/make-cron-skip-holidays/m-p/2794345#M80587</link>
      <description>Next Mon., Sept. 2nd, is Labor Day. We have a number of routine tasks that are run each weekday (Monday through Friday). Is there a utility in UNIX to tell me if the current date is a holiday? My holidays file is kept up to date but I can't find any utility that uses it. I could change my crontab to skip Monday but I would like to find something that would let me skip any holiday just by looking in the system holidays file.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance for any help,&lt;BR /&gt;Bob&lt;BR /&gt;</description>
      <pubDate>Mon, 26 Aug 2002 19:04:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/make-cron-skip-holidays/m-p/2794345#M80587</guid>
      <dc:creator>Robert Fisher_1</dc:creator>
      <dc:date>2002-08-26T19:04:18Z</dc:date>
    </item>
    <item>
      <title>Re: Make cron skip holidays?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/make-cron-skip-holidays/m-p/2794346#M80588</link>
      <description>Well Bob, you could do a date '%j' and parse the /etc/acct/holidays file yourself but why bother. &lt;BR /&gt;&lt;BR /&gt;This is much simpler:&lt;BR /&gt;&lt;BR /&gt;if [[ $(caljd.sh) -ne $(caljd.sh -h) ]]&lt;BR /&gt;  then&lt;BR /&gt;    echo "Today is a holiday."&lt;BR /&gt;  fi&lt;BR /&gt;&lt;BR /&gt;Pretty simple.&lt;BR /&gt;&lt;BR /&gt;Here's the required script. Just make sure that caljd.sh is in your PATH.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 26 Aug 2002 19:07:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/make-cron-skip-holidays/m-p/2794346#M80588</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2002-08-26T19:07:29Z</dc:date>
    </item>
    <item>
      <title>Re: Make cron skip holidays?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/make-cron-skip-holidays/m-p/2794347#M80589</link>
      <description>caljd.sh (or caljd.pl) strikes again! :)</description>
      <pubDate>Mon, 26 Aug 2002 19:09:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/make-cron-skip-holidays/m-p/2794347#M80589</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2002-08-26T19:09:05Z</dc:date>
    </item>
    <item>
      <title>Re: Make cron skip holidays?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/make-cron-skip-holidays/m-p/2794348#M80590</link>
      <description>If you had rather have a Perl version, here it is. Caljd.pl. Invoke it as caljd.pl (or .sh) -u for full usahe and you will see what the -h argument is doing.&lt;BR /&gt;</description>
      <pubDate>Mon, 26 Aug 2002 19:09:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/make-cron-skip-holidays/m-p/2794348#M80590</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2002-08-26T19:09:46Z</dc:date>
    </item>
    <item>
      <title>Re: Make cron skip holidays?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/make-cron-skip-holidays/m-p/2794349#M80591</link>
      <description>If you wanted to do things a bit harder (Clay makes it simple but some of us are suckers for the long way) then use the /etc/acct/holidays file.  As long as it is correctly updated, then you can parse out the first string of valid julian dates(day of year).&lt;BR /&gt;&lt;BR /&gt;I.E.&lt;BR /&gt;TODAY=`date +%j`&lt;BR /&gt;for DAY in `cat /etc/acct/holidays|grep -v ^\*|grep -v ^2002`; do&lt;BR /&gt;if [ "${DAY}" = "${TODAY}"  ] ; then&lt;BR /&gt;  echo "Today is a holiday"&lt;BR /&gt;  exit 0&lt;BR /&gt;else&lt;BR /&gt;  echo ""&amp;gt;&amp;gt;/dev/null&lt;BR /&gt;  #fall through, run code&lt;BR /&gt;fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Of course this requires that you have a valid file /etc/acct/holidays updated anually on each system where you will be running these kinds of scripts.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Shannon</description>
      <pubDate>Mon, 26 Aug 2002 19:21:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/make-cron-skip-holidays/m-p/2794349#M80591</guid>
      <dc:creator>Shannon Petry</dc:creator>
      <dc:date>2002-08-26T19:21:30Z</dc:date>
    </item>
    <item>
      <title>Re: Make cron skip holidays?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/make-cron-skip-holidays/m-p/2794350#M80592</link>
      <description>Shannon, I think Robert identified the real hard way: manually modify crontab not to run things on monday :-0 watch out for those typo's :-0&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Mon, 26 Aug 2002 19:23:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/make-cron-skip-holidays/m-p/2794350#M80592</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-08-26T19:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: Make cron skip holidays?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/make-cron-skip-holidays/m-p/2794351#M80593</link>
      <description>Hi again Bob:&lt;BR /&gt;&lt;BR /&gt;Because both New Year's Eve and the next New Year's Day are often holidays, I suggest that you take advantage of a little 'improvement' that I made to the holidays file. Setup  /etc/acct/holidays_2002,/etc/acct/holidays_2003, ... files. You then symbolically link holidays_YYYY to /etc/acct/holidays so that all the accounting utilities work as usual. Caljd.sh looks first for the _YYYY file so it will even cover you when you cross year boundaries. If caljd.sh does find the _YYYY holidays file; it reverts to the 'vanilla' filename so in all cases it works as expected.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 26 Aug 2002 19:33:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/make-cron-skip-holidays/m-p/2794351#M80593</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2002-08-26T19:33:26Z</dc:date>
    </item>
    <item>
      <title>Re: Make cron skip holidays?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/make-cron-skip-holidays/m-p/2794352#M80594</link>
      <description>Great. This was just what I needed. Shannon, I'm a unix guy and I'm lazy. I think I'll just use Clay's method especially after he made me think of New Years as well. It looks like he covered all the bases.&lt;BR /&gt;&lt;BR /&gt;You guys are great.&lt;BR /&gt;&lt;BR /&gt;Bob</description>
      <pubDate>Mon, 26 Aug 2002 19:40:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/make-cron-skip-holidays/m-p/2794352#M80594</guid>
      <dc:creator>Robert Fisher_1</dc:creator>
      <dc:date>2002-08-26T19:40:09Z</dc:date>
    </item>
  </channel>
</rss>

