<?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 question in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/cron-question/m-p/4665120#M41687</link>
    <description>&lt;!--!*#--&gt;&amp;gt; [...] how to get this script to look at&lt;BR /&gt;&amp;gt; time [...]&lt;BR /&gt;&lt;BR /&gt;      man date&lt;BR /&gt;&lt;BR /&gt;      x=$(date +%H)&lt;BR /&gt;      echo $x&lt;BR /&gt;&lt;BR /&gt;Test the hour in a preliminary "if"&lt;BR /&gt;statement.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; [...] Thus, the 2 step process.&lt;BR /&gt;&lt;BR /&gt;You'd probably need to do that (and look at&lt;BR /&gt;the minutes, "%M") with this scheme, too.&lt;BR /&gt;Some clever string comparisons might be&lt;BR /&gt;easier than looking at the numbers as&lt;BR /&gt;numbers.</description>
    <pubDate>Thu, 22 Jul 2010 20:31:27 GMT</pubDate>
    <dc:creator>Steven Schweda</dc:creator>
    <dc:date>2010-07-22T20:31:27Z</dc:date>
    <item>
      <title>cron question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/cron-question/m-p/4665115#M41682</link>
      <description>Good afternoon;&lt;BR /&gt;&lt;BR /&gt;IS there any way to setup a cron entry that runs every 15 minutes from 5am to 9pm.  Don't think it is possible but thought I'd ask someone who is smarter than I.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Norm&lt;BR /&gt;</description>
      <pubDate>Thu, 22 Jul 2010 19:24:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/cron-question/m-p/4665115#M41682</guid>
      <dc:creator>wvsa</dc:creator>
      <dc:date>2010-07-22T19:24:59Z</dc:date>
    </item>
    <item>
      <title>Re: cron question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/cron-question/m-p/4665116#M41683</link>
      <description>&lt;!--!*#--&gt;There might be, but it might be easier to&lt;BR /&gt;have cron run a script every 15 minutes, and&lt;BR /&gt;have that script look at the time to see if&lt;BR /&gt;it should do anything.</description>
      <pubDate>Thu, 22 Jul 2010 19:59:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/cron-question/m-p/4665116#M41683</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2010-07-22T19:59:34Z</dc:date>
    </item>
    <item>
      <title>Re: cron question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/cron-question/m-p/4665117#M41684</link>
      <description>What about the following:&lt;BR /&gt;&lt;BR /&gt;00,15,30,45 5-20 * * * /do/something&lt;BR /&gt;00 21 * * * /do/something&lt;BR /&gt;&lt;BR /&gt;The first entry will run every 15 minutes from 5:00 AM to 8:45 PM.  The 2nd entry will run at 9:00 PM.&lt;BR /&gt;&lt;BR /&gt;If you were to specify the hours of the first entry as 5-21, then your script would run at 9:00 PM, 9:15 PM, 9:30 PM and 9:45 PM, which is not desirable, if I read your question correctly.  Thus, the 2 step process.</description>
      <pubDate>Thu, 22 Jul 2010 20:16:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/cron-question/m-p/4665117#M41684</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2010-07-22T20:16:42Z</dc:date>
    </item>
    <item>
      <title>Re: cron question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/cron-question/m-p/4665118#M41685</link>
      <description>Hello Steven;&lt;BR /&gt;&lt;BR /&gt;Good idea, not sure how to do that in the script, here is the script:&lt;BR /&gt;&lt;BR /&gt; ps -ef | grep -i "httpd.conf -k" | grep -v grep&lt;BR /&gt;        if [ $? = 0 ];then&lt;BR /&gt;        echo "Zend is running on ${HOST} OK at `date`" &amp;gt;&amp;gt; $HISTFILE&lt;BR /&gt;        else&lt;BR /&gt;        sleep 1&lt;BR /&gt;        echo "Zend down on $HOST at `date`" &amp;gt; $MAILFILE1&lt;BR /&gt;        cat $MAILFILE1 | mailx -s "Zend_Down on $HOST" root&lt;BR /&gt;        cat $MAILFILE1 &amp;gt;&amp;gt; $HISTFILE&lt;BR /&gt;        fi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Let me know if you have a idea of how to get this script to look at time and not run the if statement.&lt;BR /&gt;&lt;BR /&gt;Thank you &lt;BR /&gt;&lt;BR /&gt;Norm&lt;BR /&gt;</description>
      <pubDate>Thu, 22 Jul 2010 20:17:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/cron-question/m-p/4665118#M41685</guid>
      <dc:creator>wvsa</dc:creator>
      <dc:date>2010-07-22T20:17:09Z</dc:date>
    </item>
    <item>
      <title>Re: cron question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/cron-question/m-p/4665119#M41686</link>
      <description>Patrick;&lt;BR /&gt;&lt;BR /&gt;Excellent!!!&lt;BR /&gt;&lt;BR /&gt;Thank you&lt;BR /&gt;&lt;BR /&gt;Norm&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 22 Jul 2010 20:21:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/cron-question/m-p/4665119#M41686</guid>
      <dc:creator>wvsa</dc:creator>
      <dc:date>2010-07-22T20:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: cron question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/cron-question/m-p/4665120#M41687</link>
      <description>&lt;!--!*#--&gt;&amp;gt; [...] how to get this script to look at&lt;BR /&gt;&amp;gt; time [...]&lt;BR /&gt;&lt;BR /&gt;      man date&lt;BR /&gt;&lt;BR /&gt;      x=$(date +%H)&lt;BR /&gt;      echo $x&lt;BR /&gt;&lt;BR /&gt;Test the hour in a preliminary "if"&lt;BR /&gt;statement.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; [...] Thus, the 2 step process.&lt;BR /&gt;&lt;BR /&gt;You'd probably need to do that (and look at&lt;BR /&gt;the minutes, "%M") with this scheme, too.&lt;BR /&gt;Some clever string comparisons might be&lt;BR /&gt;easier than looking at the numbers as&lt;BR /&gt;numbers.</description>
      <pubDate>Thu, 22 Jul 2010 20:31:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/cron-question/m-p/4665120#M41687</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2010-07-22T20:31:27Z</dc:date>
    </item>
    <item>
      <title>Re: cron question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/cron-question/m-p/4665121#M41688</link>
      <description>Combine Patrick and Steven:&lt;BR /&gt;&lt;BR /&gt;# Cron run every 15 min from 5:00am to 9:45pm&lt;BR /&gt;00,15,30,45 5-21 * * * myscript&lt;BR /&gt;&lt;BR /&gt;# Top of myscript&lt;BR /&gt;[ $(date +%H%M) -gt 2100 ] &amp;amp;&amp;amp; exit&lt;BR /&gt;&lt;BR /&gt;&lt;DO stuff=""&gt;&lt;BR /&gt;&lt;/DO&gt;</description>
      <pubDate>Thu, 22 Jul 2010 22:30:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/cron-question/m-p/4665121#M41688</guid>
      <dc:creator>Jared Middleton</dc:creator>
      <dc:date>2010-07-22T22:30:45Z</dc:date>
    </item>
    <item>
      <title>Re: cron question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/cron-question/m-p/4665122#M41689</link>
      <description>Hello Jared;&lt;BR /&gt;&lt;BR /&gt;Patrick response did the trick, I need to only run the script until 9pm.   Will try your add to the script.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thank you&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Norm&lt;BR /&gt;</description>
      <pubDate>Thu, 22 Jul 2010 22:47:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/cron-question/m-p/4665122#M41689</guid>
      <dc:creator>wvsa</dc:creator>
      <dc:date>2010-07-22T22:47:59Z</dc:date>
    </item>
    <item>
      <title>Re: cron question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/cron-question/m-p/4665123#M41690</link>
      <description>Actually, I was only showing what COULD be done, not what SHOULD be done.  I wouldn't recommend hardcoding a time-based exit in a script... because someone later might want it run at 11pm or whatever, and it would fail.  So, if you do include it, comment it well with the rationale/assumptions.</description>
      <pubDate>Thu, 22 Jul 2010 22:56:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/cron-question/m-p/4665123#M41690</guid>
      <dc:creator>Jared Middleton</dc:creator>
      <dc:date>2010-07-22T22:56:49Z</dc:date>
    </item>
  </channel>
</rss>

