<?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: Script to run every hr in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-run-every-hr/m-p/4365695#M684328</link>
    <description>PRESENTHR=`date '+%H'`&lt;BR /&gt;LASTHR=`expr $PRESENTHR - 1`&lt;BR /&gt;&lt;BR /&gt;The problem is the above expressions.&lt;BR /&gt;&lt;BR /&gt;When you run this during the midnight hour, which is the '0' hour, and you subtract 1 from, you get '-1'.&lt;BR /&gt;&lt;BR /&gt;You need some logic to determine that '-1' should actually be hour 23 from yesterday.  (I think JRF covers this in his response above.)</description>
    <pubDate>Tue, 24 Feb 2009 21:39:21 GMT</pubDate>
    <dc:creator>Patrick Wallek</dc:creator>
    <dc:date>2009-02-24T21:39:21Z</dc:date>
    <item>
      <title>Script to run every hr</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-run-every-hr/m-p/4365690#M684323</link>
      <description>Hi!&lt;BR /&gt;&lt;BR /&gt;I am having problems with the attached script when it runs at midnight (next day)...otherwise it runs fine.&lt;BR /&gt;&lt;BR /&gt;Can you suggest what change I can make to run it every 5 mins past the hr successfully.&lt;BR /&gt;&lt;BR /&gt;I don't want to use if statement though and I am running this thru cron.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Allan.</description>
      <pubDate>Tue, 24 Feb 2009 20:59:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-run-every-hr/m-p/4365690#M684323</guid>
      <dc:creator>Allanm</dc:creator>
      <dc:date>2009-02-24T20:59:08Z</dc:date>
    </item>
    <item>
      <title>Re: Script to run every hr</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-run-every-hr/m-p/4365691#M684324</link>
      <description>Hi Allan:&lt;BR /&gt;&lt;BR /&gt;Am I missing something?  Why not 'cron' your script like this (?):&lt;BR /&gt;&lt;BR /&gt;5 * * * * /path_to_script&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 24 Feb 2009 21:06:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-run-every-hr/m-p/4365691#M684324</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-02-24T21:06:09Z</dc:date>
    </item>
    <item>
      <title>Re: Script to run every hr</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-run-every-hr/m-p/4365692#M684325</link>
      <description>Thats what I did but it broke when it ran at 00:05.</description>
      <pubDate>Tue, 24 Feb 2009 21:21:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-run-every-hr/m-p/4365692#M684325</guid>
      <dc:creator>Allanm</dc:creator>
      <dc:date>2009-02-24T21:21:40Z</dc:date>
    </item>
    <item>
      <title>Re: Script to run every hr</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-run-every-hr/m-p/4365693#M684326</link>
      <description>Hi (again) Allan:&lt;BR /&gt;&lt;BR /&gt;Instead of fiddling around with time computations over midnight, use this Perl snippet:&lt;BR /&gt;&lt;BR /&gt;# perl -MPOSIX -le 'print strftime "%Y%m%d %H",localtime(time()-3600)'&lt;BR /&gt;20090224 15&lt;BR /&gt;&lt;BR /&gt;You can use the same 'date' formatting directives you are used to using.  This code uses 3600 seconds or ONE hour ago.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 24 Feb 2009 21:34:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-run-every-hr/m-p/4365693#M684326</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-02-24T21:34:13Z</dc:date>
    </item>
    <item>
      <title>Re: Script to run every hr</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-run-every-hr/m-p/4365694#M684327</link>
      <description>&amp;gt;&amp;gt;Thats what I did but it broke when it ran at 00:05.&lt;BR /&gt;&lt;BR /&gt;Broke how?&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt;I am having problems with the attached&lt;BR /&gt;&lt;BR /&gt;What kind of problems?&lt;BR /&gt;&lt;BR /&gt;What does it do or not do when it runs after midnight?</description>
      <pubDate>Tue, 24 Feb 2009 21:35:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-run-every-hr/m-p/4365694#M684327</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2009-02-24T21:35:09Z</dc:date>
    </item>
    <item>
      <title>Re: Script to run every hr</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-run-every-hr/m-p/4365695#M684328</link>
      <description>PRESENTHR=`date '+%H'`&lt;BR /&gt;LASTHR=`expr $PRESENTHR - 1`&lt;BR /&gt;&lt;BR /&gt;The problem is the above expressions.&lt;BR /&gt;&lt;BR /&gt;When you run this during the midnight hour, which is the '0' hour, and you subtract 1 from, you get '-1'.&lt;BR /&gt;&lt;BR /&gt;You need some logic to determine that '-1' should actually be hour 23 from yesterday.  (I think JRF covers this in his response above.)</description>
      <pubDate>Tue, 24 Feb 2009 21:39:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-run-every-hr/m-p/4365695#M684328</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2009-02-24T21:39:21Z</dc:date>
    </item>
    <item>
      <title>Re: Script to run every hr</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-run-every-hr/m-p/4365696#M684329</link>
      <description>Thanks so much JRF/Patrick. &lt;BR /&gt;&lt;BR /&gt;Just for my knowledge how would I handle this through "date" command.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Allan</description>
      <pubDate>Tue, 24 Feb 2009 22:49:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-run-every-hr/m-p/4365696#M684329</guid>
      <dc:creator>Allanm</dc:creator>
      <dc:date>2009-02-24T22:49:12Z</dc:date>
    </item>
    <item>
      <title>Re: Script to run every hr</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-run-every-hr/m-p/4365697#M684330</link>
      <description>Hi (again) Allan:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Just for my knowledge how would I handle this through "date" command&lt;BR /&gt;&lt;BR /&gt;You would have to subtract your one-hour from the hour field and if that is negative, back off by one day; maybe to the previous month; and perhaps to the previous year...&lt;BR /&gt;&lt;BR /&gt;Hence, why reinvent the wheel...&lt;BR /&gt;&lt;BR /&gt;One helpful piece if you insist on taking this route, might be to install the GNU 'date' command which can do :&lt;BR /&gt;&lt;BR /&gt;# date -d yesterday&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 24 Feb 2009 23:14:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-run-every-hr/m-p/4365697#M684330</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-02-24T23:14:06Z</dc:date>
    </item>
    <item>
      <title>Re: Script to run every hr</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-run-every-hr/m-p/4365698#M684331</link>
      <description>Shalom,&lt;BR /&gt;&lt;BR /&gt;A Clay's Date Hammer can be useful in these type of situations:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://mirrors.develooper.com/hpux/caljd-2.25.sh" target="_blank"&gt;http://mirrors.develooper.com/hpux/caljd-2.25.sh&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://mirrors.develooper.com/hpux/caljd-2.2.pl" target="_blank"&gt;http://mirrors.develooper.com/hpux/caljd-2.2.pl&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I ported it to Linux (A 1 line shell change), if you need.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Wed, 25 Feb 2009 00:20:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-run-every-hr/m-p/4365698#M684331</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2009-02-25T00:20:23Z</dc:date>
    </item>
  </channel>
</rss>

