<?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 job in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-job/m-p/3306251#M184589</link>
    <description>Sorry (mistake in hour).&lt;BR /&gt;&lt;BR /&gt;00 18 * * 1,2,3,4,5 /Job_name&lt;BR /&gt;&lt;BR /&gt;sks</description>
    <pubDate>Wed, 16 Jun 2004 02:25:40 GMT</pubDate>
    <dc:creator>Sanjay Kumar Suri</dc:creator>
    <dc:date>2004-06-16T02:25:40Z</dc:date>
    <item>
      <title>cron job</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-job/m-p/3306247#M184585</link>
      <description>how can i specify a process to run on every working day after 6.00pm except saturday, sunday and public holidays?</description>
      <pubDate>Wed, 16 Jun 2004 02:08:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-job/m-p/3306247#M184585</guid>
      <dc:creator>M.M. Oee</dc:creator>
      <dc:date>2004-06-16T02:08:45Z</dc:date>
    </item>
    <item>
      <title>Re: cron job</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-job/m-p/3306248#M184586</link>
      <description>01 18 * * 1,2,3,4,5 grep `date` file_of_holidays &amp;gt;&amp;gt; /dev/null || my_command&lt;BR /&gt; &lt;BR /&gt;Cron will do it apart from the public holiday bit.  Unfortunately, cron doesn't know about public holidays. One solution, as shown above,   would be to create a file containing the dates of public holidays and only run your script if a grep of todays date fails.</description>
      <pubDate>Wed, 16 Jun 2004 02:16:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-job/m-p/3306248#M184586</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2004-06-16T02:16:43Z</dc:date>
    </item>
    <item>
      <title>Re: cron job</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-job/m-p/3306249#M184587</link>
      <description>00 18 * * 1-5 /usr/local/nsr/bin/rt n n &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Robert-Jan</description>
      <pubDate>Wed, 16 Jun 2004 02:21:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-job/m-p/3306249#M184587</guid>
      <dc:creator>Robert-Jan Goossens</dc:creator>
      <dc:date>2004-06-16T02:21:31Z</dc:date>
    </item>
    <item>
      <title>Re: cron job</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-job/m-p/3306250#M184588</link>
      <description>00 07  * * 1,2,3,4,5  /Job_name&lt;BR /&gt;&lt;BR /&gt;There is no option to specify the holiday. Except excluding the date in first * postion and mentioning the day of the week in the 2nd last postion.&lt;BR /&gt;&lt;BR /&gt;sks</description>
      <pubDate>Wed, 16 Jun 2004 02:23:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-job/m-p/3306250#M184588</guid>
      <dc:creator>Sanjay Kumar Suri</dc:creator>
      <dc:date>2004-06-16T02:23:34Z</dc:date>
    </item>
    <item>
      <title>Re: cron job</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-job/m-p/3306251#M184589</link>
      <description>Sorry (mistake in hour).&lt;BR /&gt;&lt;BR /&gt;00 18 * * 1,2,3,4,5 /Job_name&lt;BR /&gt;&lt;BR /&gt;sks</description>
      <pubDate>Wed, 16 Jun 2004 02:25:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-job/m-p/3306251#M184589</guid>
      <dc:creator>Sanjay Kumar Suri</dc:creator>
      <dc:date>2004-06-16T02:25:40Z</dc:date>
    </item>
    <item>
      <title>Re: cron job</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-job/m-p/3306252#M184590</link>
      <description>Hi Mark Grant,&lt;BR /&gt;&lt;BR /&gt;can u give me the the format of "file_of_holidays". &lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Wed, 16 Jun 2004 03:29:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-job/m-p/3306252#M184590</guid>
      <dc:creator>M.M. Oee</dc:creator>
      <dc:date>2004-06-16T03:29:49Z</dc:date>
    </item>
    <item>
      <title>Re: cron job</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-job/m-p/3306253#M184591</link>
      <description>Well, that would be up to you really because it's only a file you create yourself, put dates in it and compare to the current system date.  It is only a grep.&lt;BR /&gt; &lt;BR /&gt;However, as an example, change the cron entry to this.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;01 18 * * 1,2,3,4,5 grep `date +"%d.%m.%y"` file_of_holidays &amp;gt;&amp;gt; /dev/null || my_command&lt;BR /&gt; &lt;BR /&gt;And then put dates in your file_of_holidays like this&lt;BR /&gt; &lt;BR /&gt;16.06.04&lt;BR /&gt;02.17.04&lt;BR /&gt; &lt;BR /&gt;etc etc etc.  I have assummed a UK date format here because I live in Norway.</description>
      <pubDate>Wed, 16 Jun 2004 03:39:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-job/m-p/3306253#M184591</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2004-06-16T03:39:38Z</dc:date>
    </item>
    <item>
      <title>Re: cron job</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-job/m-p/3306254#M184592</link>
      <description>Hai.&lt;BR /&gt;&lt;BR /&gt; crontab don't know about the holiday's. Create a file to know the holiday with the format mm/dd/yyyy as&lt;BR /&gt; &lt;BR /&gt; #--- /var/tmp/holiday ---&lt;BR /&gt; 10/15/04&lt;BR /&gt; 22/08/04&lt;BR /&gt;&lt;BR /&gt; Set the crontab settings as&lt;BR /&gt; # mins hours m-day  month  weekday  command&lt;BR /&gt;    0    18   *       *       1-5 grep `date "+%x"` /var/tmp/holiday &amp;gt;/dev/null | command&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Muthukumar</description>
      <pubDate>Wed, 16 Jun 2004 04:03:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-job/m-p/3306254#M184592</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2004-06-16T04:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: cron job</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-job/m-p/3306255#M184593</link>
      <description>Excluding the holiday in "Day of the Week" is a task.&lt;BR /&gt;&lt;BR /&gt;To include following format should work:&lt;BR /&gt;&lt;BR /&gt;grep `date "+%x"` holiday_list | date "+%Ow"&lt;BR /&gt;&lt;BR /&gt;assuming the date format in holiday_list as 06/16/04.&lt;BR /&gt;&lt;BR /&gt;sks</description>
      <pubDate>Wed, 16 Jun 2004 04:42:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-job/m-p/3306255#M184593</guid>
      <dc:creator>Sanjay Kumar Suri</dc:creator>
      <dc:date>2004-06-16T04:42:14Z</dc:date>
    </item>
    <item>
      <title>Re: cron job</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-job/m-p/3306256#M184594</link>
      <description>I got this from somewhere on the forums.  &lt;BR /&gt;&lt;BR /&gt;If you want to put a specific schedule into the program itself instead in the crontab file?  &lt;BR /&gt;&lt;BR /&gt;Well here's the code snippet......&lt;BR /&gt;# Have a $x1_listofdates in this program that gives a schedule.&lt;BR /&gt;#  2.  Run the cronjob every day from 1st to 10th of the month.&lt;BR /&gt;#  3.  Have the job exit out unless the day matches the schedule.&lt;BR /&gt;#&lt;BR /&gt;#  note:   typeset -i tells unix the value is an integer, not octal binary.&lt;BR /&gt;#------------------------------------------------------------------------------&lt;BR /&gt;typeset -i x1_day_of_month=`date +"%d"`&lt;BR /&gt;x1_month_of_year=`date +"%b"`&lt;BR /&gt;typeset -i x1_year=`date +"%Y"`&lt;BR /&gt;&lt;BR /&gt;x1_datestring=`printf "%02d%s%4d\n" $x1_day_of_month $x1_month_of_year $x1_year`&lt;BR /&gt;&lt;BR /&gt;#---SCHEDULE---o---SCHEDULE---o&lt;BR /&gt;x1_listofdates="&lt;BR /&gt;02Jun2004&lt;BR /&gt;02Jul2004&lt;BR /&gt;03Aug2004&lt;BR /&gt;02Dec2004&lt;BR /&gt;"&lt;BR /&gt;&lt;BR /&gt;x1_FLAGRUN=0&lt;BR /&gt;echo "Run the job today?"&lt;BR /&gt;for x1_D in $x1_listofdates&lt;BR /&gt;    do&lt;BR /&gt;        echo " today is  $x1_datestring  look at $x1_D from the list. "&lt;BR /&gt;    if [ "$x1_D" =  "$x1_datestring" ] ; then&lt;BR /&gt;        x1_FLAGRUN=1&lt;BR /&gt;    fi&lt;BR /&gt;done&lt;BR /&gt;if [ $x1_FLAGRUN != 1 ] ; then&lt;BR /&gt;    echo "do not run job today"&lt;BR /&gt;    exit&lt;BR /&gt;else&lt;BR /&gt;    echo "Run job today"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;In this code, I have the job only run on selected days.  But you could easily reverse it.  Note the "typeset -i" when I got to day "08", the code though it was octal, and wanted to be "10".  The -i lets it know it is an integer, not octal.&lt;BR /&gt;&lt;BR /&gt;Steve&lt;BR /&gt;</description>
      <pubDate>Thu, 17 Jun 2004 07:56:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-job/m-p/3306256#M184594</guid>
      <dc:creator>Steve Post</dc:creator>
      <dc:date>2004-06-17T07:56:34Z</dc:date>
    </item>
    <item>
      <title>Re: cron job</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-job/m-p/3306257#M184595</link>
      <description>uh hey?&lt;BR /&gt;Did you ever think that maybe you could kinda assign points to tell folks if the help is useful or not?  I see you assigned points to 0 our of your 39 questions.  &lt;BR /&gt;&lt;BR /&gt;None of the answers were useful?</description>
      <pubDate>Thu, 17 Jun 2004 07:59:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-job/m-p/3306257#M184595</guid>
      <dc:creator>Steve Post</dc:creator>
      <dc:date>2004-06-17T07:59:04Z</dc:date>
    </item>
  </channel>
</rss>

