<?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 Help Needed. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-help-needed/m-p/3160585#M159334</link>
    <description>Thanks for the help.  I kind of figured that the wasn't a way to set it up in the cron.  I'll just schedule it for every Friday and have my script exit if the date isn't with in the 1st through 7th range.  Thanks again everyone.</description>
    <pubDate>Fri, 09 Jan 2004 11:00:27 GMT</pubDate>
    <dc:creator>William McElvain</dc:creator>
    <dc:date>2004-01-09T11:00:27Z</dc:date>
    <item>
      <title>CRON Help Needed.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-help-needed/m-p/3160580#M159329</link>
      <description>I want to set my cron to run a script on the first Friday of the month at 7:01 and only on the first Friday of the month.  I have tried to set it using the following crontab line&lt;BR /&gt;01 7 1-7 * 5 /scriptname&lt;BR /&gt;However, instead of only running the script on a Friday that is also the 1st, 2nd, 3rd, 4th, 5th, 6th, or 7th of the month, it will run it every Friday and also every day of the month between the 1st and 7th.&lt;BR /&gt;</description>
      <pubDate>Fri, 09 Jan 2004 10:31:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-help-needed/m-p/3160580#M159329</guid>
      <dc:creator>William McElvain</dc:creator>
      <dc:date>2004-01-09T10:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: CRON Help Needed.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-help-needed/m-p/3160581#M159330</link>
      <description>William,&lt;BR /&gt;&lt;BR /&gt;The easiest way to accomplish this would be to put the logic inside your script to determine if it's Friday or not.  Cron has no mechanism for this.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Fri, 09 Jan 2004 10:33:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-help-needed/m-p/3160581#M159330</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2004-01-09T10:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: CRON Help Needed.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-help-needed/m-p/3160582#M159331</link>
      <description>Another option is to run it every friday and test to see if todays date is &amp;lt;= 7.&lt;BR /&gt;&lt;BR /&gt;-Dave</description>
      <pubDate>Fri, 09 Jan 2004 10:34:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-help-needed/m-p/3160582#M159331</guid>
      <dc:creator>Dave Johnson_1</dc:creator>
      <dc:date>2004-01-09T10:34:47Z</dc:date>
    </item>
    <item>
      <title>Re: CRON Help Needed.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-help-needed/m-p/3160583#M159332</link>
      <description>Yep, cron can't do this&lt;BR /&gt; &lt;BR /&gt;You should get cron to run the thing every Friday but add the following to the top of the script&lt;BR /&gt; &lt;BR /&gt;[ `date +%d` -gt 6 ] &amp;amp;&amp;amp; exit</description>
      <pubDate>Fri, 09 Jan 2004 10:36:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-help-needed/m-p/3160583#M159332</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2004-01-09T10:36:52Z</dc:date>
    </item>
    <item>
      <title>Re: CRON Help Needed.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-help-needed/m-p/3160584#M159333</link>
      <description>Your fundamental problem is that cron's logic is OR'ing your request and you really need an AND. Cron won't do this on its own but my solution for all things date related is caljd.sh.&lt;BR /&gt;&lt;BR /&gt;In your case, the fix is to have cron run your script every Friday and then add a test within the script itself to determine if this is the 1st (or 2nd, 3rd) ...&lt;BR /&gt;&lt;BR /&gt;if [[ $(caljd.sh -N) -eq 1 ]]&lt;BR /&gt;then&lt;BR /&gt;  echo "First Friday; Do your thing"&lt;BR /&gt;else&lt;BR /&gt;  echo "It ain't, exit"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 09 Jan 2004 10:48:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-help-needed/m-p/3160584#M159333</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2004-01-09T10:48:23Z</dc:date>
    </item>
    <item>
      <title>Re: CRON Help Needed.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-help-needed/m-p/3160585#M159334</link>
      <description>Thanks for the help.  I kind of figured that the wasn't a way to set it up in the cron.  I'll just schedule it for every Friday and have my script exit if the date isn't with in the 1st through 7th range.  Thanks again everyone.</description>
      <pubDate>Fri, 09 Jan 2004 11:00:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-help-needed/m-p/3160585#M159334</guid>
      <dc:creator>William McElvain</dc:creator>
      <dc:date>2004-01-09T11:00:27Z</dc:date>
    </item>
  </channel>
</rss>

