<?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 Setup in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-setup/m-p/2518523#M23264</link>
    <description>I just went back and reread the question and double checked my response.  I think I messed up on your script2 setup.  &lt;BR /&gt;&lt;BR /&gt;What I had would go every 5 minutes from 4 AM to 8PM every day of the week.  If I read correctly what you need is every 5 minutes 24 hours a day from 4AM Sunday to 8:30 PM Saturday.  To do that you would need to do the following:&lt;BR /&gt;&lt;BR /&gt;#The following will run the script every 5 minutes from 4:00AM till 23:55 PM Sunday&lt;BR /&gt;0,5,10,15,20,25,30,35,40,45,50,55 4-23 * * 0 /file/script2.sh&lt;BR /&gt;&lt;BR /&gt;#The following will run the script every 5 minutes 24 Hours a day Monday - Friday&lt;BR /&gt;0,5,10,15,20,25,30,35,40,45,50,55 * * * 1-5 /file/script2.sh&lt;BR /&gt;&lt;BR /&gt;#The following will run the script every 5 mintes from Midnight till 19:55 Saturday&lt;BR /&gt;0,5,10,15,20,25,30,35,40,45,50,55 0-19 * * 6 /file/script2.sh&lt;BR /&gt;&lt;BR /&gt;# The following will run the script every 5 minutes from 20:00 till 20:30 Saturday&lt;BR /&gt;0,5,10,15,20,25,30 20 * * 6 /file/script2.sh &lt;BR /&gt;&lt;BR /&gt;Unfortunately this is the only way I can think of to run the script with your time requirements.</description>
    <pubDate>Wed, 18 Apr 2001 18:37:40 GMT</pubDate>
    <dc:creator>Patrick Wallek</dc:creator>
    <dc:date>2001-04-18T18:37:40Z</dc:date>
    <item>
      <title>CRON Setup</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-setup/m-p/2518520#M23261</link>
      <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;I need to setup two new jobs in CRON.&lt;BR /&gt;&lt;BR /&gt;1. To run every Sat. night at 8:45 to&lt;BR /&gt;  execute /filename/script.sh&lt;BR /&gt;&lt;BR /&gt;2. 4am Sunday morning to 8:30pm Saturday nite&lt;BR /&gt;to execute at 5 mins intervals.  To execute the&lt;BR /&gt;file below every 5 mins. in the range above.&lt;BR /&gt;&lt;BR /&gt;/filename/script2.sh&lt;BR /&gt;&lt;BR /&gt;How would I enter this in cron?&lt;BR /&gt;&lt;BR /&gt;Review on how to set this up...It's been a while and the last time I setup cron, I load&lt;BR /&gt;it several times and caused problems.&lt;BR /&gt;&lt;BR /&gt;TIA,&lt;BR /&gt;&lt;BR /&gt;Laurie Krumrey (formerly Laurie Brown)</description>
      <pubDate>Wed, 18 Apr 2001 18:17:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-setup/m-p/2518520#M23261</guid>
      <dc:creator>Laurie A. Krumrey</dc:creator>
      <dc:date>2001-04-18T18:17:06Z</dc:date>
    </item>
    <item>
      <title>Re: CRON Setup</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-setup/m-p/2518521#M23262</link>
      <description>Laurie,&lt;BR /&gt;&lt;BR /&gt;Your crontab entries would look as follows:&lt;BR /&gt;&lt;BR /&gt;45 20 * * 6  /filename/script.sh&lt;BR /&gt;&lt;BR /&gt;0,5,10,15,20,25,30,35,40,45,50,55 4-20 * * 0-6  /filename/script2.sh&lt;BR /&gt;&lt;BR /&gt;Use 'crontab -e' while logged in as the appropriate user to put these entries into that users crontab file.  Do a 'crontab -l' to list crontab entries.&lt;BR /&gt;&lt;BR /&gt;The syntax of a line in cron is:&lt;BR /&gt;&lt;BR /&gt;minute hour day-of-month month day-of-week command to run&lt;BR /&gt;&lt;BR /&gt;Any field with a * in it will run for all values of that field (every minute, every hour, every day of month, every month, every day of the week).  The days of the week are specified as 0-6 where 0=Sunday, 1=Monday, etc.   The hour is specified as 24 hour time.  Do a 'man crontab' for more information.</description>
      <pubDate>Wed, 18 Apr 2001 18:28:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-setup/m-p/2518521#M23262</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2001-04-18T18:28:40Z</dc:date>
    </item>
    <item>
      <title>Re: CRON Setup</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-setup/m-p/2518522#M23263</link>
      <description>crontab -e&lt;BR /&gt;insert&lt;BR /&gt;&lt;BR /&gt;45 8 * * 6 /filename/script.sh&lt;BR /&gt;00,05,10,15,20,25,30,35,40,45,50,55 * * * 1-5 /filename/script2.sh&lt;BR /&gt;00,05,10,15,20,25,30,35,40,45,50,55 00-19 * * 6 /filename/script2.sh&lt;BR /&gt;00,05,10,15,20,25,30,35,40,45,50,55 04-23 * * 0 /filename/script2.sh&lt;BR /&gt;&lt;BR /&gt;Should do it.&lt;BR /&gt;&lt;BR /&gt;...jcd...&lt;BR /&gt; &lt;BR /&gt;</description>
      <pubDate>Wed, 18 Apr 2001 18:36:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-setup/m-p/2518522#M23263</guid>
      <dc:creator>Joseph C. Denman</dc:creator>
      <dc:date>2001-04-18T18:36:03Z</dc:date>
    </item>
    <item>
      <title>Re: CRON Setup</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-setup/m-p/2518523#M23264</link>
      <description>I just went back and reread the question and double checked my response.  I think I messed up on your script2 setup.  &lt;BR /&gt;&lt;BR /&gt;What I had would go every 5 minutes from 4 AM to 8PM every day of the week.  If I read correctly what you need is every 5 minutes 24 hours a day from 4AM Sunday to 8:30 PM Saturday.  To do that you would need to do the following:&lt;BR /&gt;&lt;BR /&gt;#The following will run the script every 5 minutes from 4:00AM till 23:55 PM Sunday&lt;BR /&gt;0,5,10,15,20,25,30,35,40,45,50,55 4-23 * * 0 /file/script2.sh&lt;BR /&gt;&lt;BR /&gt;#The following will run the script every 5 minutes 24 Hours a day Monday - Friday&lt;BR /&gt;0,5,10,15,20,25,30,35,40,45,50,55 * * * 1-5 /file/script2.sh&lt;BR /&gt;&lt;BR /&gt;#The following will run the script every 5 mintes from Midnight till 19:55 Saturday&lt;BR /&gt;0,5,10,15,20,25,30,35,40,45,50,55 0-19 * * 6 /file/script2.sh&lt;BR /&gt;&lt;BR /&gt;# The following will run the script every 5 minutes from 20:00 till 20:30 Saturday&lt;BR /&gt;0,5,10,15,20,25,30 20 * * 6 /file/script2.sh &lt;BR /&gt;&lt;BR /&gt;Unfortunately this is the only way I can think of to run the script with your time requirements.</description>
      <pubDate>Wed, 18 Apr 2001 18:37:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-setup/m-p/2518523#M23264</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2001-04-18T18:37:40Z</dc:date>
    </item>
    <item>
      <title>Re: CRON Setup</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-setup/m-p/2518524#M23265</link>
      <description>Case 1 is easy:&lt;BR /&gt;as root:&lt;BR /&gt;1. crontab -l &amp;gt; /tmp/root&lt;BR /&gt;2. vi /tmp/root &amp;amp; enter the following&lt;BR /&gt;45 20 * * 6 /filename/script.sh&lt;BR /&gt;3. Save file &amp;amp; crontab &amp;lt; /tmp/root&lt;BR /&gt;4. Check your work with crontab -l&lt;BR /&gt;&lt;BR /&gt;Case 2 is a bit more tedious:&lt;BR /&gt;Same crontab &amp;amp; vi steps as above with these&lt;BR /&gt;entries:&lt;BR /&gt;# To take care of Mon-Fri&lt;BR /&gt;0,5,10,15,20,25,30,35,40,45,50,55 * * 1-5 /filename/script2.sh&lt;BR /&gt;# Sun&lt;BR /&gt;0,5,10,15,20,25,30,35,40,45,50,55 4-23 * * 0 /filename/script2.sh&lt;BR /&gt;# Sat&lt;BR /&gt;0,5,10,15,20,25,30,35,40,45,50,55 4-23  * * 6 /filename/script2.sh&lt;BR /&gt;0,5,10,15,20,25,30 20 * * 6 /filename/script2.sh&lt;BR /&gt;&lt;BR /&gt;That should do it.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 18 Apr 2001 18:39:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-setup/m-p/2518524#M23265</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2001-04-18T18:39:02Z</dc:date>
    </item>
    <item>
      <title>Re: CRON Setup</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-setup/m-p/2518525#M23266</link>
      <description>whoops missed on, but patrick got it.&lt;BR /&gt;&lt;BR /&gt;also:&lt;BR /&gt;&lt;BR /&gt;0,5,10,15,20,25,30 20 * * 6 /filename/script2.sh&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 18 Apr 2001 18:42:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-setup/m-p/2518525#M23266</guid>
      <dc:creator>Joseph C. Denman</dc:creator>
      <dc:date>2001-04-18T18:42:17Z</dc:date>
    </item>
    <item>
      <title>Re: CRON Setup</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-setup/m-p/2518526#M23267</link>
      <description>Patrick, I think you got it the first time, the requirement, to me looks as if the job is required to go from 4 in the morning Sunday, all the way till Saturday night, without interuption. Probably so that Saturday job can maybe run some kind of report????</description>
      <pubDate>Wed, 18 Apr 2001 18:54:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-setup/m-p/2518526#M23267</guid>
      <dc:creator>Jim Moffitt_1</dc:creator>
      <dc:date>2001-04-18T18:54:16Z</dc:date>
    </item>
    <item>
      <title>Re: CRON Setup</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-setup/m-p/2518527#M23268</link>
      <description>Thanks Everyone it's working great...&lt;BR /&gt;&lt;BR /&gt;However..I don't want cron sending email&lt;BR /&gt;every 5 minutes to root...Can I tell it&lt;BR /&gt;only to send email if there is a problem and&lt;BR /&gt;not to sent email other wise?&lt;BR /&gt;&lt;BR /&gt;Here's what I get in root's email:&lt;BR /&gt;&lt;BR /&gt;ubject: cron&lt;BR /&gt;Status: R&lt;BR /&gt;&lt;BR /&gt;running&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;*************************************************&lt;BR /&gt;Cron: The previous message is the standard output&lt;BR /&gt;      and standard error of one of your crontab commands:&lt;BR /&gt;&lt;BR /&gt;/usr/ops/autotree/scripts/file.sh &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 18 Apr 2001 19:32:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-setup/m-p/2518527#M23268</guid>
      <dc:creator>Laurie A. Krumrey</dc:creator>
      <dc:date>2001-04-18T19:32:12Z</dc:date>
    </item>
    <item>
      <title>Re: CRON Setup</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/cron-setup/m-p/2518528#M23269</link>
      <description>2 ways to deal with this:&lt;BR /&gt;If you are confident that your command(s) alway(s) succeeds:&lt;BR /&gt;Within your script:&lt;BR /&gt;my_cmd &amp;gt; /dev/null 2&amp;gt;&amp;gt;/dev/null&lt;BR /&gt;to redirect both stdout &amp;amp; stderr to /dev/null&lt;BR /&gt;or&lt;BR /&gt;Something like this:&lt;BR /&gt;TFILE1=/var/tmp/X$$_1.txt&lt;BR /&gt;my_cmd &amp;gt; ${TFILE1} 2&amp;gt;&amp;gt;${TFILE1}&lt;BR /&gt;STAT=$?&lt;BR /&gt;if [ ${STAT} -ne 0 -a -s $TFILE1 ]&lt;BR /&gt;  then&lt;BR /&gt;    cat $TFILE1&lt;BR /&gt;  fi&lt;BR /&gt;rm -f $TFILE1&lt;BR /&gt;&lt;BR /&gt;If the exit status of my_cmd is non-zero,&lt;BR /&gt;then the stdout &amp;amp; stderr of my_cmd is echoed&lt;BR /&gt;and picked up by mail from cron&lt;BR /&gt;&lt;BR /&gt;You would need to do this for each separate command in your script that you desire to monitor for error or wrapper the whole thing.&lt;BR /&gt;</description>
      <pubDate>Wed, 18 Apr 2001 19:43:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/cron-setup/m-p/2518528#M23269</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2001-04-18T19:43:31Z</dc:date>
    </item>
  </channel>
</rss>

