<?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 Entry  - Please Advice. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-entry-please-advice/m-p/3599210#M232706</link>
    <description>Hello,&lt;BR /&gt;&lt;BR /&gt;I just came up with one logic which is &lt;BR /&gt;&lt;BR /&gt;[ `date +\%d` -ne 1 ] &lt;BR /&gt;&lt;BR /&gt;Is this logic which Iam using is Korn shell specific.&lt;BR /&gt;Please Advice.</description>
    <pubDate>Fri, 12 Aug 2005 00:05:46 GMT</pubDate>
    <dc:creator>Saraswathy_1</dc:creator>
    <dc:date>2005-08-12T00:05:46Z</dc:date>
    <item>
      <title>Cron Entry  - Please Advice.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-entry-please-advice/m-p/3599199#M232695</link>
      <description>Hello All,&lt;BR /&gt;&lt;BR /&gt;I do not want to run /home/saras/dudd  script on every first day of the month and saturday. so the crontab entry looks like below. &lt;BR /&gt;&lt;BR /&gt;30 1 2-31 * 0-5 /home/saras/dudd &lt;BR /&gt;&lt;BR /&gt;I could skip on saturday facing problem with first day of the month. Though I gave 2-31 still its running on 1st day of the month.&lt;BR /&gt;Iam using HP UNIX 11.11&lt;BR /&gt;&lt;BR /&gt;Please advice in this matter.</description>
      <pubDate>Tue, 09 Aug 2005 02:25:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-entry-please-advice/m-p/3599199#M232695</guid>
      <dc:creator>Saraswathy_1</dc:creator>
      <dc:date>2005-08-09T02:25:48Z</dc:date>
    </item>
    <item>
      <title>Re: Cron Entry  - Please Advice.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-entry-please-advice/m-p/3599200#M232696</link>
      <description>Entries in the 3rd and 5th column in crontab are cumulative. So your cronjob will be run on 2-31 day of each month PLUS Sunday to Friday.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 09 Aug 2005 02:39:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-entry-please-advice/m-p/3599200#M232696</guid>
      <dc:creator>Ermin Borovac</dc:creator>
      <dc:date>2005-08-09T02:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: Cron Entry  - Please Advice.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-entry-please-advice/m-p/3599201#M232697</link>
      <description>Hi,&lt;BR /&gt;I think you must specify the corect day according to the month,so i think you must create 12 line job.For example at Year 2005:&lt;BR /&gt;jan :31 days&lt;BR /&gt;feb: 28 days&lt;BR /&gt;mar: 31 days&lt;BR /&gt;...&lt;BR /&gt;dec:31 days&lt;BR /&gt;so change your crontab file to:&lt;BR /&gt;0 1 2-31 1 0-5 /home/saras/dudd &lt;BR /&gt;0 1 2-28 2 0-5 /home/saras/dudd &lt;BR /&gt;....&lt;BR /&gt;0 1 2-31 12 0-5 /home/saras/dudd</description>
      <pubDate>Tue, 09 Aug 2005 02:41:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-entry-please-advice/m-p/3599201#M232697</guid>
      <dc:creator>morganelan</dc:creator>
      <dc:date>2005-08-09T02:41:51Z</dc:date>
    </item>
    <item>
      <title>Re: Cron Entry  - Please Advice.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-entry-please-advice/m-p/3599202#M232698</link>
      <description>Can you try like this,&lt;BR /&gt;&lt;BR /&gt;30 1 * * 0-5  /home/saras/dudd 1&amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;in  /home/saras/dudd put in the begin like,&lt;BR /&gt;&lt;BR /&gt;if [[ $(date +'%d') -eq 1 ]]&lt;BR /&gt;then&lt;BR /&gt;  echo "No need to run"&lt;BR /&gt;  exit 0&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;hth.</description>
      <pubDate>Tue, 09 Aug 2005 02:54:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-entry-please-advice/m-p/3599202#M232698</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-08-09T02:54:13Z</dc:date>
    </item>
    <item>
      <title>Re: Cron Entry  - Please Advice.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-entry-please-advice/m-p/3599203#M232699</link>
      <description>I suggest testing within the script (or as part of another script) for the first day of the month.&lt;BR /&gt;&lt;BR /&gt;if [ `date | awk '{print $3}' | bc` -ne 1 ]&lt;BR /&gt;then&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;Then the cron entry would look like this:&lt;BR /&gt;&lt;BR /&gt;30 1 * * 0-5 /home/saras/dudd&lt;BR /&gt;&lt;BR /&gt;That is the way I would do it.&lt;BR /&gt;&lt;BR /&gt;There is probably a way to do it just using cron too.</description>
      <pubDate>Tue, 09 Aug 2005 03:08:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-entry-please-advice/m-p/3599203#M232699</guid>
      <dc:creator>Gavin Clarke</dc:creator>
      <dc:date>2005-08-09T03:08:20Z</dc:date>
    </item>
    <item>
      <title>Re: Cron Entry  - Please Advice.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-entry-please-advice/m-p/3599204#M232700</link>
      <description>I regret for conveying wrong problem. The Actual problem -&lt;BR /&gt;Though I give 0-5 days the script executed on saturday. which I do not want.&lt;BR /&gt;&lt;BR /&gt;30 1 2-31 * 0-5 /home/saras/dudd &lt;BR /&gt;&lt;BR /&gt;Mr. Ermin Borovac, Could you please elaborate on this&lt;BR /&gt;&lt;BR /&gt;"Entries in the 3rd and 5th column in crontab are cumulative. So your cronjob will be run on 2-31 day of each month PLUS Sunday to Friday".&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 09 Aug 2005 12:13:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-entry-please-advice/m-p/3599204#M232700</guid>
      <dc:creator>Saraswathy_1</dc:creator>
      <dc:date>2005-08-09T12:13:40Z</dc:date>
    </item>
    <item>
      <title>Re: Cron Entry  - Please Advice.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-entry-please-advice/m-p/3599205#M232701</link>
      <description>Here is something that could help. &lt;BR /&gt;Call a script that has the logic built into it. &lt;BR /&gt;&lt;BR /&gt;set `date +'%d %w'`&lt;BR /&gt;DAY=$1&lt;BR /&gt;WEEKDAY=$2&lt;BR /&gt;&lt;BR /&gt;if [ "$WEEKDAY" != "6" ]&lt;BR /&gt;then&lt;BR /&gt;  /home/saras/dudd&lt;BR /&gt;else&lt;BR /&gt;  echo "Not running script"&lt;BR /&gt;  exit&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;Basically saying that this script checks the WEEKDAY and if it is SAT (6) then do not run dudds and exit.&lt;BR /&gt;&lt;BR /&gt;The cron entry looks like&lt;BR /&gt;30 1 2-31 * *  &lt;THE_SCRIPT_ABOVE&gt;&lt;BR /&gt;&lt;BR /&gt;This cron entry will execute the script everyday of the year except the 1st day of a month. The logic in the script says not to run 'dudd' on Saturdays.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;/THE_SCRIPT_ABOVE&gt;</description>
      <pubDate>Tue, 09 Aug 2005 12:42:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-entry-please-advice/m-p/3599205#M232701</guid>
      <dc:creator>Rick Garland</dc:creator>
      <dc:date>2005-08-09T12:42:13Z</dc:date>
    </item>
    <item>
      <title>Re: Cron Entry  - Please Advice.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-entry-please-advice/m-p/3599206#M232702</link>
      <description>31 1 2-31 * * [[ `date +\%u` -ne 6 ]] &amp;amp;&amp;amp; /home/saras/dudd&lt;BR /&gt;&lt;BR /&gt;that should should run your script 2-31 of every month but not on saturdays. &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 09 Aug 2005 15:04:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-entry-please-advice/m-p/3599206#M232702</guid>
      <dc:creator>Marvin Strong</dc:creator>
      <dc:date>2005-08-09T15:04:47Z</dc:date>
    </item>
    <item>
      <title>Re: Cron Entry  - Please Advice.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-entry-please-advice/m-p/3599207#M232703</link>
      <description>Hi Marvin,&lt;BR /&gt;&lt;BR /&gt;Could you please tell how exactly the below statement is going to work. Just curious to know &lt;BR /&gt;&lt;BR /&gt;[[ `date +\%u` -ne 6 ]] &amp;amp;&amp;amp;  &lt;BR /&gt;&lt;BR /&gt;Since the cron log shows :-&lt;BR /&gt;&lt;BR /&gt;CMD: [[ `date +%u` -ne 2 ]] &amp;amp;&amp;amp; date&amp;gt;/home/infra/dat&lt;BR /&gt;&lt;BR /&gt;Does cron considers the above statement as single command ? Please clarify</description>
      <pubDate>Wed, 10 Aug 2005 01:46:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-entry-please-advice/m-p/3599207#M232703</guid>
      <dc:creator>Saraswathy_1</dc:creator>
      <dc:date>2005-08-10T01:46:33Z</dc:date>
    </item>
    <item>
      <title>Re: Cron Entry  - Please Advice.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-entry-please-advice/m-p/3599208#M232704</link>
      <description>Just in case Marvin doesn't get back to you, the construct "[[ some test ]] &amp;amp;&amp;amp; some job" works out as "do some job if some test is successfull".  The &amp;amp;&amp;amp; makes the command on the right run if the exit status of the command on the left is 0. The opposite is ||</description>
      <pubDate>Wed, 10 Aug 2005 01:50:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-entry-please-advice/m-p/3599208#M232704</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2005-08-10T01:50:42Z</dc:date>
    </item>
    <item>
      <title>Re: Cron Entry  - Please Advice.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-entry-please-advice/m-p/3599209#M232705</link>
      <description>As Mark stated, the test [[ `date +\%u -ne 2 ]]&lt;BR /&gt;&lt;BR /&gt;executes the date command getting day of the week as 1 - 7 (sunday is 7) if that does not equal 2 then it runs the script.  Thus it will be false on Tuedays and would not run the script. Since false is a non-zero return. &lt;BR /&gt;&lt;BR /&gt;Cron runs entries in the Posix shell that is why the [[ ]] syntax works. &lt;BR /&gt;</description>
      <pubDate>Wed, 10 Aug 2005 08:25:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-entry-please-advice/m-p/3599209#M232705</guid>
      <dc:creator>Marvin Strong</dc:creator>
      <dc:date>2005-08-10T08:25:17Z</dc:date>
    </item>
    <item>
      <title>Re: Cron Entry  - Please Advice.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-entry-please-advice/m-p/3599210#M232706</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;I just came up with one logic which is &lt;BR /&gt;&lt;BR /&gt;[ `date +\%d` -ne 1 ] &lt;BR /&gt;&lt;BR /&gt;Is this logic which Iam using is Korn shell specific.&lt;BR /&gt;Please Advice.</description>
      <pubDate>Fri, 12 Aug 2005 00:05:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-entry-please-advice/m-p/3599210#M232706</guid>
      <dc:creator>Saraswathy_1</dc:creator>
      <dc:date>2005-08-12T00:05:46Z</dc:date>
    </item>
    <item>
      <title>Re: Cron Entry  - Please Advice.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-entry-please-advice/m-p/3599211#M232707</link>
      <description>[ `date +%d` -ne 1 ] &amp;amp;&amp;amp; will work as,&lt;BR /&gt;&lt;BR /&gt;if [[ `date +$d` -ne 1 ]]&lt;BR /&gt;then&lt;BR /&gt;  Only one expression;&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;If you don't want to execute /home/saras/dudd script on first day of month simply do in the /home/saras/dudd script as,&lt;BR /&gt;&lt;BR /&gt;[[ $(date +%d) -eq 1 ]] &amp;amp;&amp;amp; exit 0;&lt;BR /&gt;&lt;BR /&gt;in the begining of script.&lt;BR /&gt;&lt;BR /&gt;hth.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 12 Aug 2005 00:35:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-entry-please-advice/m-p/3599211#M232707</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-08-12T00:35:10Z</dc:date>
    </item>
    <item>
      <title>Re: Cron Entry  - Please Advice.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-entry-please-advice/m-p/3599212#M232708</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;This can be done in two ways&lt;BR /&gt;1. In crontab include dates 2-31 and modify the script in such a way that it does not run on Saturday. or&lt;BR /&gt;&lt;BR /&gt;2. In crontab include the days except sat and modify the script to check the date and does not execute on 1st day of month...&lt;BR /&gt;&lt;BR /&gt;Enjoy!!!&lt;BR /&gt;eknath</description>
      <pubDate>Fri, 12 Aug 2005 00:36:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-entry-please-advice/m-p/3599212#M232708</guid>
      <dc:creator>Eknath</dc:creator>
      <dc:date>2005-08-12T00:36:37Z</dc:date>
    </item>
    <item>
      <title>Re: Cron Entry  - Please Advice.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-entry-please-advice/m-p/3599213#M232709</link>
      <description>See man ksh for Conditional Expressions and [[ expression ]] part.&lt;BR /&gt;&lt;BR /&gt;If you don't want to execute on first day of month and saturday of the week then,&lt;BR /&gt;&lt;BR /&gt;30 1 * * * [[ $(date +%d) -ne 1 || $(date +%w) -ne 5 ]] &amp;amp;&amp;amp; /home/saras/dudd 1&amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;hth.</description>
      <pubDate>Fri, 12 Aug 2005 00:43:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-entry-please-advice/m-p/3599213#M232709</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-08-12T00:43:40Z</dc:date>
    </item>
  </channel>
</rss>

