<?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: Cron Tab in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-tab/m-p/4986796#M780240</link>
    <description>The idea is to run your script every Monday and then let it decide if it should execute or not.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Install the attached utility, caljd.sh, in a directory (e.g. /usr/local/bin) and then your cron'ed script should look something like this:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;typeset -i STAT=0&lt;BR /&gt;export PATH=${PATH}:/usr/bin:/usr/local/bin&lt;BR /&gt;&lt;BR /&gt;typeset -i WK=$(( ($(caljd.sh) / 7) % 2 ))&lt;BR /&gt;if [[ ${WK} -eq 0 ]] # depending upon the week you want to start this might need to be -eq 1&lt;BR /&gt;  then&lt;BR /&gt;    echo "Do your thing"&lt;BR /&gt;  fi&lt;BR /&gt;exit ${STAT}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;This will work across year boundaries, leap years, whatever because caljd.sh in this form returns a sequential number of days since 1-Jan 4004 BCE. Invoke as caljd.sh -u for full usage and examples.&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 21 Jun 2006 09:56:42 GMT</pubDate>
    <dc:creator>A. Clay Stephenson</dc:creator>
    <dc:date>2006-06-21T09:56:42Z</dc:date>
    <item>
      <title>Cron Tab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-tab/m-p/4986792#M780236</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I want to execute one script on alternate mondays. &lt;BR /&gt;&lt;BR /&gt;any idea how can i configure cron ?&lt;BR /&gt;&lt;BR /&gt;thanks in advance.</description>
      <pubDate>Wed, 21 Jun 2006 09:43:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-tab/m-p/4986792#M780236</guid>
      <dc:creator>Montu_1</dc:creator>
      <dc:date>2006-06-21T09:43:48Z</dc:date>
    </item>
    <item>
      <title>Re: Cron Tab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-tab/m-p/4986793#M780237</link>
      <description>See Clay's response to the follwoing thread.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=113380" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=113380&lt;/A&gt;</description>
      <pubDate>Wed, 21 Jun 2006 09:50:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-tab/m-p/4986793#M780237</guid>
      <dc:creator>Jeff_Traigle</dc:creator>
      <dc:date>2006-06-21T09:50:10Z</dc:date>
    </item>
    <item>
      <title>Re: Cron Tab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-tab/m-p/4986794#M780238</link>
      <description>I suggest you an alternate way as I cannot think how it can soley be deployed using cron.&lt;BR /&gt;In cron allow the script to run every Monday.&lt;BR /&gt;And in the script check if this is a say even Monday or a odd Monday using date +%V or %W whichever is suitable and allow the script to run if its the alternate Monday.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Ninad</description>
      <pubDate>Wed, 21 Jun 2006 09:50:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-tab/m-p/4986794#M780238</guid>
      <dc:creator>Ninad_1</dc:creator>
      <dc:date>2006-06-21T09:50:57Z</dc:date>
    </item>
    <item>
      <title>Re: Cron Tab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-tab/m-p/4986795#M780239</link>
      <description>There isn't any way within cron itself.  You will need to run the script every Monday, and then, within the script, determine if it is a Monday that it should run on.&lt;BR /&gt;&lt;BR /&gt;There is a script (cal_jd.sh) and perl version of same (cal_jd.pl) around here somewhere that may assist you in this</description>
      <pubDate>Wed, 21 Jun 2006 09:56:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-tab/m-p/4986795#M780239</guid>
      <dc:creator>OldSchool</dc:creator>
      <dc:date>2006-06-21T09:56:21Z</dc:date>
    </item>
    <item>
      <title>Re: Cron Tab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-tab/m-p/4986796#M780240</link>
      <description>The idea is to run your script every Monday and then let it decide if it should execute or not.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Install the attached utility, caljd.sh, in a directory (e.g. /usr/local/bin) and then your cron'ed script should look something like this:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;typeset -i STAT=0&lt;BR /&gt;export PATH=${PATH}:/usr/bin:/usr/local/bin&lt;BR /&gt;&lt;BR /&gt;typeset -i WK=$(( ($(caljd.sh) / 7) % 2 ))&lt;BR /&gt;if [[ ${WK} -eq 0 ]] # depending upon the week you want to start this might need to be -eq 1&lt;BR /&gt;  then&lt;BR /&gt;    echo "Do your thing"&lt;BR /&gt;  fi&lt;BR /&gt;exit ${STAT}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;This will work across year boundaries, leap years, whatever because caljd.sh in this form returns a sequential number of days since 1-Jan 4004 BCE. Invoke as caljd.sh -u for full usage and examples.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Jun 2006 09:56:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-tab/m-p/4986796#M780240</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2006-06-21T09:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: Cron Tab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-tab/m-p/4986797#M780241</link>
      <description>Drat, Bishop Usher confused me. I meant to say that caljd.sh counts days sequentially from 4713 BCE.</description>
      <pubDate>Wed, 21 Jun 2006 10:02:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-tab/m-p/4986797#M780241</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2006-06-21T10:02:12Z</dc:date>
    </item>
    <item>
      <title>Re: Cron Tab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-tab/m-p/4986798#M780242</link>
      <description>I really should make a small correction so that the weeks actually begin on the more traditional Sunday (although in your case, it won't make any real difference). Adding 1 to the Julian days has that effect.&lt;BR /&gt;&lt;BR /&gt;typeset -i WK=$(( (($(caljd.sh) + 1) / 7) % 2 ))&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Jun 2006 10:41:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-tab/m-p/4986798#M780242</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2006-06-21T10:41:49Z</dc:date>
    </item>
    <item>
      <title>Re: Cron Tab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-tab/m-p/4986799#M780243</link>
      <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;Thanks for your valued reply,&lt;BR /&gt;&lt;BR /&gt;sorry for delay in points!.&lt;BR /&gt;</description>
      <pubDate>Mon, 26 Jun 2006 15:25:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-tab/m-p/4986799#M780243</guid>
      <dc:creator>Montu_1</dc:creator>
      <dc:date>2006-06-26T15:25:11Z</dc:date>
    </item>
  </channel>
</rss>

