<?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: crontab job in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-job/m-p/4102108#M312042</link>
    <description>&amp;gt;yogeeraj: 00 07 1 * 1,2 my_script&lt;BR /&gt;&amp;gt;This means run my_script only when "Day of month" = 1 AND "Day of week" is Monday or Tuesday. &lt;BR /&gt;&lt;BR /&gt;That's NOT what the man page says.  Only tztab does AND.  crontab(1) says:&lt;BR /&gt;If both are specified in an entry, they are cumulative.</description>
    <pubDate>Wed, 14 Nov 2007 04:50:31 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2007-11-14T04:50:31Z</dc:date>
    <item>
      <title>crontab job</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-job/m-p/4102102#M312036</link>
      <description>I want to setup a crontab job that run on monday , tuesday and 1st of every month , 07:00 , I have set " 00 07 1 * 1,2 my_script " , is it correct ? assume next monday is also 1st of the month ( meet both condition ) , will it duplicate run my_script ?&lt;BR /&gt;&lt;BR /&gt;thx</description>
      <pubDate>Wed, 14 Nov 2007 02:48:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-job/m-p/4102102#M312036</guid>
      <dc:creator>ust3</dc:creator>
      <dc:date>2007-11-14T02:48:04Z</dc:date>
    </item>
    <item>
      <title>Re: crontab job</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-job/m-p/4102103#M312037</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;yes it seems correct. &lt;BR /&gt;And if 1st of the month will be on monday or tuesday then the script will run only once.&lt;BR /&gt;&lt;BR /&gt;Short extract from cron manpage:&lt;BR /&gt;&lt;BR /&gt;When a command is specified to run at an ambiguous time, the command is executed only once at the first occurrence of the ambiguous time.&lt;BR /&gt;&lt;BR /&gt;Gabriel</description>
      <pubDate>Wed, 14 Nov 2007 03:51:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-job/m-p/4102103#M312037</guid>
      <dc:creator>Gabriel Suchter</dc:creator>
      <dc:date>2007-11-14T03:51:10Z</dc:date>
    </item>
    <item>
      <title>Re: crontab job</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-job/m-p/4102104#M312038</link>
      <description>make two entries:&lt;BR /&gt;&lt;BR /&gt;00 07 1 * * my_script   #1st of mont&lt;BR /&gt;00 07 * * 1,2 my_script #monday and tuesday&lt;BR /&gt;&lt;BR /&gt;Regards</description>
      <pubDate>Wed, 14 Nov 2007 03:56:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-job/m-p/4102104#M312038</guid>
      <dc:creator>Oviwan</dc:creator>
      <dc:date>2007-11-14T03:56:46Z</dc:date>
    </item>
    <item>
      <title>Re: crontab job</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-job/m-p/4102105#M312039</link>
      <description>&amp;gt;Oviwan: make two entries:&lt;BR /&gt;&lt;BR /&gt;This will do it twice.&lt;BR /&gt;Better to let it OR as Gabriel said.&lt;BR /&gt;(A comment may be helpful if you think the OR is tricky.)</description>
      <pubDate>Wed, 14 Nov 2007 04:27:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-job/m-p/4102105#M312039</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-11-14T04:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: crontab job</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-job/m-p/4102106#M312040</link>
      <description>&lt;!--!*#--&gt;hi,&lt;BR /&gt;&lt;BR /&gt;&amp;gt; " 00 07 1 * 1,2 my_script " &lt;BR /&gt;This mean run my_script only when "Day of month" = 1 AND "Day of week" is Monday or Tuesday. &lt;BR /&gt;Of course, not what you want.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt;Oviman&lt;BR /&gt;00 07 1 * * my_script #1st of month&lt;BR /&gt;00 07 * * 1,2 my_script #monday and tuesday&lt;BR /&gt;&lt;BR /&gt;This will run twice if "Day of Month" is 1 and it is ALSO either monday or tuesday.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;What you need:&lt;BR /&gt;==============&lt;BR /&gt;#*******************************************************************************&lt;BR /&gt;# min|hour |day  |month|day  |script&lt;BR /&gt;#    |     |of mo|     |of wk|&lt;BR /&gt;#----|-----|-----|-----|-----|--------------------------------------------------&lt;BR /&gt;#*******************************************************************************&lt;BR /&gt;00    07    1     *      *    my_script #1st of month&lt;BR /&gt;00    07    *     *      1,2  [ ! $(date +%e)=1 ] &amp;amp;&amp;amp; my_script #run if not 1st&lt;BR /&gt;#*******************************************************************************&lt;BR /&gt;# END OF TABLE           day0-&amp;gt;Sunday  day6-&amp;gt;Saturday&lt;BR /&gt;#*******************************************************************************&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;kind regards&lt;BR /&gt;yogeeraj</description>
      <pubDate>Wed, 14 Nov 2007 04:42:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-job/m-p/4102106#M312040</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2007-11-14T04:42:07Z</dc:date>
    </item>
    <item>
      <title>Re: crontab job</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-job/m-p/4102107#M312041</link>
      <description>&lt;!--!*#--&gt;hi again,&lt;BR /&gt;&lt;BR /&gt;Sorry missed the explanations.&lt;BR /&gt;&lt;BR /&gt;00    07    1     *      *    my_script #1st of month&lt;BR /&gt;00    07    *     *      1,2  [ ! $(date +%e)=1 ] &amp;amp;&amp;amp; my_script #run if not 1st&lt;BR /&gt;&lt;BR /&gt;The first line:&lt;BR /&gt;Run every 1st day of the Month&lt;BR /&gt;&lt;BR /&gt;The Second line:&lt;BR /&gt;Run every monday and tuesday, except if either is the 1st day of the month -- taken care by the 1st line.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Hope this helps!&lt;BR /&gt;&lt;BR /&gt;kind regards&lt;BR /&gt;yogeeraj</description>
      <pubDate>Wed, 14 Nov 2007 04:48:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-job/m-p/4102107#M312041</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2007-11-14T04:48:00Z</dc:date>
    </item>
    <item>
      <title>Re: crontab job</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-job/m-p/4102108#M312042</link>
      <description>&amp;gt;yogeeraj: 00 07 1 * 1,2 my_script&lt;BR /&gt;&amp;gt;This means run my_script only when "Day of month" = 1 AND "Day of week" is Monday or Tuesday. &lt;BR /&gt;&lt;BR /&gt;That's NOT what the man page says.  Only tztab does AND.  crontab(1) says:&lt;BR /&gt;If both are specified in an entry, they are cumulative.</description>
      <pubDate>Wed, 14 Nov 2007 04:50:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-job/m-p/4102108#M312042</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-11-14T04:50:31Z</dc:date>
    </item>
    <item>
      <title>Re: crontab job</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-job/m-p/4102109#M312043</link>
      <description>hi Dennis,&lt;BR /&gt;&lt;BR /&gt;Thanks a lot for these clarifications. I really had missed that!&lt;BR /&gt;&lt;BR /&gt;Below the quote from "man 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;&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;&lt;BR /&gt;kind regards&lt;BR /&gt;yogeeraj</description>
      <pubDate>Wed, 14 Nov 2007 05:04:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-job/m-p/4102109#M312043</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2007-11-14T05:04:33Z</dc:date>
    </item>
    <item>
      <title>Re: crontab job</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-job/m-p/4102110#M312044</link>
      <description>to summarise:&lt;BR /&gt;&lt;BR /&gt;this should work fine for you:&lt;BR /&gt;&lt;BR /&gt;00 07 1 * 1,2 my_script&lt;BR /&gt;&lt;BR /&gt;kind regards&lt;BR /&gt;yogeeraj</description>
      <pubDate>Wed, 14 Nov 2007 05:06:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-job/m-p/4102110#M312044</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2007-11-14T05:06:36Z</dc:date>
    </item>
    <item>
      <title>Re: crontab job</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-job/m-p/4102111#M312045</link>
      <description>thx all replies,&lt;BR /&gt;&lt;BR /&gt;so what I need to set ?  my above setting is correct ? or I need to set as below ? thx.&lt;BR /&gt;&lt;BR /&gt;00    07    1     *      *    my_script #1st of month&lt;BR /&gt;00    07    *     *      1,2  [ ! $(date +%e)=1 ] &amp;amp;&amp;amp; my_script #run if not 1st</description>
      <pubDate>Wed, 14 Nov 2007 22:01:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-job/m-p/4102111#M312045</guid>
      <dc:creator>ust3</dc:creator>
      <dc:date>2007-11-14T22:01:24Z</dc:date>
    </item>
    <item>
      <title>Re: crontab job</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-job/m-p/4102112#M312046</link>
      <description>Just a better way to work with cron&lt;BR /&gt;Put these line in crontab files.&lt;BR /&gt;#minute (0-59),&lt;BR /&gt;#|      hour (0-23),&lt;BR /&gt;#|      |       day of the month (1-31),&lt;BR /&gt;#|      |       |       month of the year (1-12),&lt;BR /&gt;#|      |       |       |       day of the week (0-6 with 0=Sunday).&lt;BR /&gt;#|      |       |       |       |       commands&lt;BR /&gt;0       2       *       *       0,4     /etc/cron.d/logchecker&lt;BR /&gt;&lt;BR /&gt;Thanks to UGU :)&lt;BR /&gt;Kapil</description>
      <pubDate>Wed, 14 Nov 2007 22:11:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-job/m-p/4102112#M312046</guid>
      <dc:creator>Kapil Jha</dc:creator>
      <dc:date>2007-11-14T22:11:30Z</dc:date>
    </item>
    <item>
      <title>Re: crontab job</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-job/m-p/4102113#M312047</link>
      <description>&amp;gt;my above setting is correct? &lt;BR /&gt;&lt;BR /&gt;Yes.  I finally convinced Yogeeraj that his complex version wasn't needed.&lt;BR /&gt;See his:&lt;BR /&gt;to summarize: this should work fine for you:</description>
      <pubDate>Wed, 14 Nov 2007 22:18:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-job/m-p/4102113#M312047</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-11-14T22:18:14Z</dc:date>
    </item>
    <item>
      <title>Re: crontab job</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-job/m-p/4102114#M312048</link>
      <description>thx reply,&lt;BR /&gt;&lt;BR /&gt;I have one addition question , if I want run on 1st of month when if it is Mon or Tue , can advise how to set ? thx&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 14 Nov 2007 23:17:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-job/m-p/4102114#M312048</guid>
      <dc:creator>ust3</dc:creator>
      <dc:date>2007-11-14T23:17:16Z</dc:date>
    </item>
    <item>
      <title>Re: crontab job</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/crontab-job/m-p/4102115#M312049</link>
      <description>&amp;gt;if I want run on 1st of month when if it is Mon or Tue, can advise how to set?&lt;BR /&gt;&lt;BR /&gt;You want to run on first AND ONLY if it is Mon or Tue?&lt;BR /&gt;You reverse what Yogeeraj had.  (And fiddle with it a little. :-)&lt;BR /&gt;&lt;BR /&gt;00 07 * * 1,2 [ $(date +%d) -eq 1 ] &amp;amp;&amp;amp; my_script #run if 1st&lt;BR /&gt;&lt;BR /&gt;Note you can also put the date check in the script so you don't clutter up the crontab.&lt;BR /&gt;</description>
      <pubDate>Thu, 15 Nov 2007 00:26:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/crontab-job/m-p/4102115#M312049</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-11-15T00:26:14Z</dc:date>
    </item>
  </channel>
</rss>

