<?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: cronjob question? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/cronjob-question/m-p/4890361#M402209</link>
    <description>Cron by itself can't do this. You need to schedule the cronjob to run every Monday and then the script itself needs to test whether or not this is the 3rd Monday of a given month. The easist solution is caljd.sh. I'll assume that you install the attached script in /usr/local/bin&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;export PATH=${PATH}:/usr/local/bin&lt;BR /&gt;&lt;BR /&gt;if [[ $(caljd.sh -N) -eq 3 ]]&lt;BR /&gt;  then&lt;BR /&gt;    echo "It's the 3rd Monday; do your thing"&lt;BR /&gt;  else&lt;BR /&gt;    exit 0&lt;BR /&gt;  fi&lt;BR /&gt;&lt;BR /&gt;Invoke as caljd.sh -u for full usage and examples.</description>
    <pubDate>Wed, 09 Mar 2005 12:27:26 GMT</pubDate>
    <dc:creator>A. Clay Stephenson</dc:creator>
    <dc:date>2005-03-09T12:27:26Z</dc:date>
    <item>
      <title>cronjob question?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cronjob-question/m-p/4890357#M402205</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;How do I schedule a job to run every third Monday of the month?&lt;BR /&gt;&lt;BR /&gt;Thanks.</description>
      <pubDate>Wed, 09 Mar 2005 12:20:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cronjob-question/m-p/4890357#M402205</guid>
      <dc:creator>Ridzuan Zakaria</dc:creator>
      <dc:date>2005-03-09T12:20:40Z</dc:date>
    </item>
    <item>
      <title>Re: cronjob question?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cronjob-question/m-p/4890358#M402206</link>
      <description>I don't think it's possible with cron.&lt;BR /&gt;&lt;BR /&gt;You can specify weekday and month day, but not both. But you can write custom script that run monday and check if it's third monday of the months and if yes it runs it.</description>
      <pubDate>Wed, 09 Mar 2005 12:25:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cronjob-question/m-p/4890358#M402206</guid>
      <dc:creator>Alex Lavrov.</dc:creator>
      <dc:date>2005-03-09T12:25:39Z</dc:date>
    </item>
    <item>
      <title>Re: cronjob question?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cronjob-question/m-p/4890359#M402207</link>
      <description>You don't.  You schedule it to run every Monday and determine in the script itself if the day of the month falls between 15 and 22.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Wed, 09 Mar 2005 12:26:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cronjob-question/m-p/4890359#M402207</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2005-03-09T12:26:32Z</dc:date>
    </item>
    <item>
      <title>Re: cronjob question?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cronjob-question/m-p/4890360#M402208</link>
      <description>Similar question (for a different day)&lt;BR /&gt;&lt;BR /&gt;see thread&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=827914" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=827914&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Jean-Luc</description>
      <pubDate>Wed, 09 Mar 2005 12:27:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cronjob-question/m-p/4890360#M402208</guid>
      <dc:creator>Jean-Luc Oudart</dc:creator>
      <dc:date>2005-03-09T12:27:20Z</dc:date>
    </item>
    <item>
      <title>Re: cronjob question?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cronjob-question/m-p/4890361#M402209</link>
      <description>Cron by itself can't do this. You need to schedule the cronjob to run every Monday and then the script itself needs to test whether or not this is the 3rd Monday of a given month. The easist solution is caljd.sh. I'll assume that you install the attached script in /usr/local/bin&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;export PATH=${PATH}:/usr/local/bin&lt;BR /&gt;&lt;BR /&gt;if [[ $(caljd.sh -N) -eq 3 ]]&lt;BR /&gt;  then&lt;BR /&gt;    echo "It's the 3rd Monday; do your thing"&lt;BR /&gt;  else&lt;BR /&gt;    exit 0&lt;BR /&gt;  fi&lt;BR /&gt;&lt;BR /&gt;Invoke as caljd.sh -u for full usage and examples.</description>
      <pubDate>Wed, 09 Mar 2005 12:27:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cronjob-question/m-p/4890361#M402209</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-03-09T12:27:26Z</dc:date>
    </item>
    <item>
      <title>Re: cronjob question?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cronjob-question/m-p/4890362#M402210</link>
      <description>Thanks. I used solution provided by Clay.</description>
      <pubDate>Wed, 09 Mar 2005 12:32:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cronjob-question/m-p/4890362#M402210</guid>
      <dc:creator>Ridzuan Zakaria</dc:creator>
      <dc:date>2005-03-09T12:32:48Z</dc:date>
    </item>
  </channel>
</rss>

