<?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: How to get cronjobs to skip holidays? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-cronjobs-to-skip-holidays/m-p/2954143#M116705</link>
    <description>Here is the thread from yesterday:&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x6e219607df6ed711abdc0090277a778c,00.html" target="_blank"&gt;http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x6e219607df6ed711abdc0090277a778c,00.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;You could probably have used the search function and searched on "cron and holiday" and probably would have gotten some hits.</description>
    <pubDate>Thu, 17 Apr 2003 15:38:06 GMT</pubDate>
    <dc:creator>Patrick Wallek</dc:creator>
    <dc:date>2003-04-17T15:38:06Z</dc:date>
    <item>
      <title>How to get cronjobs to skip holidays?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-cronjobs-to-skip-holidays/m-p/2954140#M116702</link>
      <description>Hello Experts,&lt;BR /&gt;&lt;BR /&gt;I have a number of cronjobs that run every weekday that I don't want to run on holidays like Good Friday. Is there a file that cron can read to skip holidays? I've looked at the man pages and found nothing.&lt;BR /&gt;&lt;BR /&gt;Thanks, &lt;BR /&gt;Derek&lt;BR /&gt;</description>
      <pubDate>Thu, 17 Apr 2003 15:32:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-cronjobs-to-skip-holidays/m-p/2954140#M116702</guid>
      <dc:creator>Derek Card</dc:creator>
      <dc:date>2003-04-17T15:32:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to get cronjobs to skip holidays?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-cronjobs-to-skip-holidays/m-p/2954141#M116703</link>
      <description>Hi Derek:&lt;BR /&gt;&lt;BR /&gt;That question came up yesterday and the answer is still the same - no, not directly. You should continue to run your cronjob daily BUT it should determine if today is a holiday.&lt;BR /&gt;&lt;BR /&gt;1) Edit and update /etc/acct/holidays. I actually prefer that you create a file /etc/acct/holidays_YYYY and link /etc/acct/holidays to it for the current year.&lt;BR /&gt;&lt;BR /&gt;2) Add something like this to your cron'ed script:&lt;BR /&gt;&lt;BR /&gt;if [[ $(caljd.sh -h) -ne $(caljd.sh) ]]&lt;BR /&gt;  then&lt;BR /&gt;    echo "Today is a holiday"&lt;BR /&gt;    exit 0&lt;BR /&gt;  fi&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 17 Apr 2003 15:36:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-cronjobs-to-skip-holidays/m-p/2954141#M116703</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2003-04-17T15:36:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to get cronjobs to skip holidays?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-cronjobs-to-skip-holidays/m-p/2954142#M116704</link>
      <description>Check this link which got magical answer.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x6e219607df6ed711abdc0090277a778c,00.html" target="_blank"&gt;http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x6e219607df6ed711abdc0090277a778c,00.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Zafar</description>
      <pubDate>Thu, 17 Apr 2003 15:37:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-cronjobs-to-skip-holidays/m-p/2954142#M116704</guid>
      <dc:creator>Zafar A. Mohammed_1</dc:creator>
      <dc:date>2003-04-17T15:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to get cronjobs to skip holidays?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-cronjobs-to-skip-holidays/m-p/2954143#M116705</link>
      <description>Here is the thread from yesterday:&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x6e219607df6ed711abdc0090277a778c,00.html" target="_blank"&gt;http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x6e219607df6ed711abdc0090277a778c,00.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;You could probably have used the search function and searched on "cron and holiday" and probably would have gotten some hits.</description>
      <pubDate>Thu, 17 Apr 2003 15:38:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-cronjobs-to-skip-holidays/m-p/2954143#M116705</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2003-04-17T15:38:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to get cronjobs to skip holidays?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-cronjobs-to-skip-holidays/m-p/2954144#M116706</link>
      <description>Derek,&lt;BR /&gt;&lt;BR /&gt;There is a file called /usr/lib/X11/datebook/holidays (hopefully it's on your system) that could be used, with a fairly substantial amount of effort, by a cron script to determine if a give day was a holiday.  Then the cron script could proceed or exit depending on the comparison.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Thu, 17 Apr 2003 15:39:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-cronjobs-to-skip-holidays/m-p/2954144#M116706</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2003-04-17T15:39:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to get cronjobs to skip holidays?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-cronjobs-to-skip-holidays/m-p/2954145#M116707</link>
      <description>Clay's (Mr. Date's) solution is probably much better.  It requires some manual effort to enter the holidays for each year, but avoids having to deal with things like this (from /usr/lib/X11/datebook/holidays):&lt;BR /&gt;&lt;BR /&gt;"Thanksgiving"&lt;BR /&gt;=holiday&lt;BR /&gt;4th Thursday in November at 12:00 AM&lt;BR /&gt;&lt;BR /&gt;and the other "floating" holidays.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Thu, 17 Apr 2003 15:45:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-cronjobs-to-skip-holidays/m-p/2954145#M116707</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2003-04-17T15:45:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to get cronjobs to skip holidays?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-cronjobs-to-skip-holidays/m-p/2954146#M116708</link>
      <description>Hi Gang,&lt;BR /&gt;&lt;BR /&gt;Thanks for the amazing quick solutions. It looks like Clay's is the one to beat. Clay, I have one question. You said that you wanted me to create a holidays_YYYY file and link it to holidays. Why?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Derek&lt;BR /&gt;</description>
      <pubDate>Thu, 17 Apr 2003 15:50:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-cronjobs-to-skip-holidays/m-p/2954146#M116708</guid>
      <dc:creator>Derek Card</dc:creator>
      <dc:date>2003-04-17T15:50:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to get cronjobs to skip holidays?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-cronjobs-to-skip-holidays/m-p/2954147#M116709</link>
      <description>Hi Derek:&lt;BR /&gt;&lt;BR /&gt;The answer is quite simple. Unlike the cheaper brands which purport to do Julian Days, caljd.sh actually does Julian Days and thus spans thousands of years - leap years and all without an if.&lt;BR /&gt;&lt;BR /&gt;Consider the case of Dec 31, 2003 (New Year's Eve) AND Jan 1, 2004 (New Year's Day) both being holidays. The vanilla UNIX /etc/acct/holidays file was never meant to span years. Caljd.sh first looks to see if there is a holidays_YYYY file for whatever current year its calculation fall in and then look at the plain holidays file. &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 17 Apr 2003 15:55:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-cronjobs-to-skip-holidays/m-p/2954147#M116709</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2003-04-17T15:55:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to get cronjobs to skip holidays?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-cronjobs-to-skip-holidays/m-p/2954148#M116710</link>
      <description>Thanks everybody. I created a "fake" holiday entry for today and it worked great. I also saw how to use caljd.sh in another thread to calculate the day offsets that the /etc/acct/holidays file expects. That sure beats counting days on a  calendar to get the offset values!&lt;BR /&gt;&lt;BR /&gt;Thanks again,&lt;BR /&gt;Derek&lt;BR /&gt;</description>
      <pubDate>Thu, 17 Apr 2003 17:27:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-cronjobs-to-skip-holidays/m-p/2954148#M116710</guid>
      <dc:creator>Derek Card</dc:creator>
      <dc:date>2003-04-17T17:27:36Z</dc:date>
    </item>
  </channel>
</rss>

