<?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 schedule a cron job to run on the third thursday of the month. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-schedule-a-cron-job-to-run-on-the-third-thursday-of-the/m-p/2806969#M83269</link>
    <description>Last try... need to go home now. :)&lt;BR /&gt;&lt;BR /&gt;1 1 * * 4 (( ($(date "+%e")-1) / 7 +1 == 3 )) &amp;amp;&amp;amp; echo This is the job! &lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Mon, 16 Sep 2002 15:21:28 GMT</pubDate>
    <dc:creator>Dietmar Konermann</dc:creator>
    <dc:date>2002-09-16T15:21:28Z</dc:date>
    <item>
      <title>how to schedule a cron job to run on the third thursday of the month.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-schedule-a-cron-job-to-run-on-the-third-thursday-of-the/m-p/2806958#M83258</link>
      <description>Hello, &lt;BR /&gt;I'm hoping someone can help me write this properly. I have a job I need to run on the 3rd thursday of the month, every month. I've tried the following line in my crontab but it doesn't work properly: &lt;BR /&gt;1 1 15,16,17,18,19,20,21 * 5 /optim/bin/testcron.scr #&lt;BR /&gt;&lt;BR /&gt;Thanks so much!!! &lt;BR /&gt;</description>
      <pubDate>Mon, 16 Sep 2002 14:52:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-schedule-a-cron-job-to-run-on-the-third-thursday-of-the/m-p/2806958#M83258</guid>
      <dc:creator>John Henrikson</dc:creator>
      <dc:date>2002-09-16T14:52:49Z</dc:date>
    </item>
    <item>
      <title>Re: how to schedule a cron job to run on the third thursday of the month.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-schedule-a-cron-job-to-run-on-the-third-thursday-of-the/m-p/2806959#M83259</link>
      <description>For a start, the 5 should be a 4.  day 0 is Sunday, 1 Monday etc.</description>
      <pubDate>Mon, 16 Sep 2002 15:03:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-schedule-a-cron-job-to-run-on-the-third-thursday-of-the/m-p/2806959#M83259</guid>
      <dc:creator>Chris Wilshaw</dc:creator>
      <dc:date>2002-09-16T15:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: how to schedule a cron job to run on the third thursday of the month.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-schedule-a-cron-job-to-run-on-the-third-thursday-of-the/m-p/2806960#M83260</link>
      <description>First thing first - The last position (day of the week) should be 4 for thursday! 5 is for friday!</description>
      <pubDate>Mon, 16 Sep 2002 15:04:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-schedule-a-cron-job-to-run-on-the-third-thursday-of-the/m-p/2806960#M83260</guid>
      <dc:creator>Helen French</dc:creator>
      <dc:date>2002-09-16T15:04:31Z</dc:date>
    </item>
    <item>
      <title>Re: how to schedule a cron job to run on the third thursday of the month.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-schedule-a-cron-job-to-run-on-the-third-thursday-of-the/m-p/2806961#M83261</link>
      <description>You're correct of course, but the problem is its running each day that I have stipulated.. thanks though</description>
      <pubDate>Mon, 16 Sep 2002 15:04:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-schedule-a-cron-job-to-run-on-the-third-thursday-of-the/m-p/2806961#M83261</guid>
      <dc:creator>John Henrikson</dc:creator>
      <dc:date>2002-09-16T15:04:55Z</dc:date>
    </item>
    <item>
      <title>Re: how to schedule a cron job to run on the third thursday of the month.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-schedule-a-cron-job-to-run-on-the-third-thursday-of-the/m-p/2806962#M83262</link>
      <description>One option is to call another date check script from the cron tab:&lt;BR /&gt;&lt;BR /&gt;1 1 ..... * 5 /optim/bin/cron_date_check #&lt;BR /&gt;&lt;BR /&gt;Add these lines in the script:&lt;BR /&gt;if [ `date |awk '{print$1}'` = "Thu" ]&lt;BR /&gt;then&lt;BR /&gt;/optim/bin/testcron.scr&lt;BR /&gt;fi&lt;BR /&gt;</description>
      <pubDate>Mon, 16 Sep 2002 15:10:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-schedule-a-cron-job-to-run-on-the-third-thursday-of-the/m-p/2806962#M83262</guid>
      <dc:creator>Helen French</dc:creator>
      <dc:date>2002-09-16T15:10:52Z</dc:date>
    </item>
    <item>
      <title>Re: how to schedule a cron job to run on the third thursday of the month.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-schedule-a-cron-job-to-run-on-the-third-thursday-of-the/m-p/2806963#M83263</link>
      <description>OK,&lt;BR /&gt;&lt;BR /&gt;Change the 5 (or 4) to a *&lt;BR /&gt;&lt;BR /&gt;Then it should just run on the specified dates.&lt;BR /&gt;&lt;BR /&gt;You can then build logic into your script to test if date +%a is equal to Thu, and only continue if it is.</description>
      <pubDate>Mon, 16 Sep 2002 15:11:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-schedule-a-cron-job-to-run-on-the-third-thursday-of-the/m-p/2806963#M83263</guid>
      <dc:creator>Chris Wilshaw</dc:creator>
      <dc:date>2002-09-16T15:11:49Z</dc:date>
    </item>
    <item>
      <title>Re: how to schedule a cron job to run on the third thursday of the month.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-schedule-a-cron-job-to-run-on-the-third-thursday-of-the/m-p/2806964#M83264</link>
      <description>To quote the man page for crontab,&lt;BR /&gt;&lt;BR /&gt;Note that the specification of days can be made in two fields: monthday and weekday.&lt;BR /&gt;If both are specified in an entry, they are cumulative.  For example,&lt;BR /&gt;&lt;BR /&gt;           0   0   1,15   *   1   command&lt;BR /&gt;&lt;BR /&gt;runs command at midnight on the first and fifteenth of each month, as well as every Monday.&lt;BR /&gt;&lt;BR /&gt;Which explains why is is always running on those days.&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;&lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Mon, 16 Sep 2002 15:13:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-schedule-a-cron-job-to-run-on-the-third-thursday-of-the/m-p/2806964#M83264</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2002-09-16T15:13:10Z</dc:date>
    </item>
    <item>
      <title>Re: how to schedule a cron job to run on the third thursday of the month.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-schedule-a-cron-job-to-run-on-the-third-thursday-of-the/m-p/2806965#M83265</link>
      <description>Hi John&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I think&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;1 1 15,16,17,18,19,20,21 * 4 /optim/bin/testcron.scr , should work fine&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Manoj Srivastava</description>
      <pubDate>Mon, 16 Sep 2002 15:16:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-schedule-a-cron-job-to-run-on-the-third-thursday-of-the/m-p/2806965#M83265</guid>
      <dc:creator>MANOJ SRIVASTAVA</dc:creator>
      <dc:date>2002-09-16T15:16:57Z</dc:date>
    </item>
    <item>
      <title>Re: how to schedule a cron job to run on the third thursday of the month.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-schedule-a-cron-job-to-run-on-the-third-thursday-of-the/m-p/2806966#M83266</link>
      <description>You have a fundamental problem in that you are expecting that if you specify a weekday (4 - Thursdays) and a range of monthdays that both conditions must be true but in fact only one condition has to be true. The fields are OR'ed rather than AND'ed.&lt;BR /&gt;&lt;BR /&gt;The correct solution is to run your command every Thursday (weekday 4) and then inside the script do a 2nd test.&lt;BR /&gt;&lt;BR /&gt;e.g.&lt;BR /&gt;&lt;BR /&gt;MDAY=$(date '+%m')&lt;BR /&gt;if [[ $(MDAY} -ge 15 &amp;amp;&amp;amp; ${MDAY} -le 21 ]]&lt;BR /&gt;  then&lt;BR /&gt;    echo "Run your commands; it's the 3rd Thursday"&lt;BR /&gt;  else&lt;BR /&gt;    echo "Exit; not the 3rd Thursday"&lt;BR /&gt;  fi&lt;BR /&gt;</description>
      <pubDate>Mon, 16 Sep 2002 15:17:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-schedule-a-cron-job-to-run-on-the-third-thursday-of-the/m-p/2806966#M83266</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2002-09-16T15:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: how to schedule a cron job to run on the third thursday of the month.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-schedule-a-cron-job-to-run-on-the-third-thursday-of-the/m-p/2806967#M83267</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I fear that cron' syntax is not able to handle it (maybe I'm missing something).&lt;BR /&gt;&lt;BR /&gt;But you could use a workaound... schedule the job for EACH Thursday and check if it's the 3rd one, e.g.:&lt;BR /&gt;&lt;BR /&gt;1 1 * * 5  (( ($(date "+%e")-1) / 7 +1 == 3 )) &amp;amp;&amp;amp; echo This is the job!&lt;BR /&gt;&lt;BR /&gt;Only a rapid prototype... hope it works. :-)&lt;BR /&gt;&lt;BR /&gt;Regards...&lt;BR /&gt; Dietmar.</description>
      <pubDate>Mon, 16 Sep 2002 15:18:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-schedule-a-cron-job-to-run-on-the-third-thursday-of-the/m-p/2806967#M83267</guid>
      <dc:creator>Dietmar Konermann</dc:creator>
      <dc:date>2002-09-16T15:18:49Z</dc:date>
    </item>
    <item>
      <title>Re: how to schedule a cron job to run on the third thursday of the month.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-schedule-a-cron-job-to-run-on-the-third-thursday-of-the/m-p/2806968#M83268</link>
      <description>Oops. Thursday is 4.&lt;BR /&gt;&lt;BR /&gt;1 1 * * 5 (( ($(date "+%e")-1) / 7 +1 == 3 )) &amp;amp;&amp;amp; echo This is the job! &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 16 Sep 2002 15:20:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-schedule-a-cron-job-to-run-on-the-third-thursday-of-the/m-p/2806968#M83268</guid>
      <dc:creator>Dietmar Konermann</dc:creator>
      <dc:date>2002-09-16T15:20:01Z</dc:date>
    </item>
    <item>
      <title>Re: how to schedule a cron job to run on the third thursday of the month.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-schedule-a-cron-job-to-run-on-the-third-thursday-of-the/m-p/2806969#M83269</link>
      <description>Last try... need to go home now. :)&lt;BR /&gt;&lt;BR /&gt;1 1 * * 4 (( ($(date "+%e")-1) / 7 +1 == 3 )) &amp;amp;&amp;amp; echo This is the job! &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 16 Sep 2002 15:21:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-schedule-a-cron-job-to-run-on-the-third-thursday-of-the/m-p/2806969#M83269</guid>
      <dc:creator>Dietmar Konermann</dc:creator>
      <dc:date>2002-09-16T15:21:28Z</dc:date>
    </item>
  </channel>
</rss>

