<?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 Questions in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-questions/m-p/5014956#M427269</link>
    <description>James, I am new to scripting.  How would I be able to do this check every 2 to 3 hours?&lt;BR /&gt;I would somehow have to make that reference point time be 2 or 3 hours prior to the time that I do the check.  Is there a way to do that?</description>
    <pubDate>Mon, 20 Nov 2006 16:30:38 GMT</pubDate>
    <dc:creator>Andre Lemon</dc:creator>
    <dc:date>2006-11-20T16:30:38Z</dc:date>
    <item>
      <title>Script Questions</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-questions/m-p/5014954#M427267</link>
      <description>Is it possible to create a script that will check to see which files have been modified and or created in the past # of hours?  I want to check this due to a directories space&lt;BR /&gt;jumping quite a bit at various times of the day.  I want to try to pinpoint as much as possible what is causing this.</description>
      <pubDate>Mon, 20 Nov 2006 16:10:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-questions/m-p/5014954#M427267</guid>
      <dc:creator>Andre Lemon</dc:creator>
      <dc:date>2006-11-20T16:10:42Z</dc:date>
    </item>
    <item>
      <title>Re: Script Questions</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-questions/m-p/5014955#M427268</link>
      <description>Hi Andre:&lt;BR /&gt;&lt;BR /&gt;# touch -amt 11200001 /tmp/myref&lt;BR /&gt;# find /path -xdev -type f -newer /tmp/myref&lt;BR /&gt;&lt;BR /&gt;The above will create a reference point beginning at November 20 at 0001.  The 'find' will look for *files* in the '/path' that have been created or modified since then.  The '-xdev' option prevents crossing mountpoints -- most useful if you want to search the root ('/' directory.&lt;BR /&gt;&lt;BR /&gt;See the manpages for 'find' for more information.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 20 Nov 2006 16:21:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-questions/m-p/5014955#M427268</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-11-20T16:21:43Z</dc:date>
    </item>
    <item>
      <title>Re: Script Questions</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-questions/m-p/5014956#M427269</link>
      <description>James, I am new to scripting.  How would I be able to do this check every 2 to 3 hours?&lt;BR /&gt;I would somehow have to make that reference point time be 2 or 3 hours prior to the time that I do the check.  Is there a way to do that?</description>
      <pubDate>Mon, 20 Nov 2006 16:30:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-questions/m-p/5014956#M427269</guid>
      <dc:creator>Andre Lemon</dc:creator>
      <dc:date>2006-11-20T16:30:38Z</dc:date>
    </item>
    <item>
      <title>Re: Script Questions</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-questions/m-p/5014957#M427270</link>
      <description>&amp;gt;I would somehow have to make that reference point time be 2 or 3 hours prior to the time that I do the check.&lt;BR /&gt;&lt;BR /&gt;By using date +%m%d%H%M you can get:  11201344&lt;BR /&gt;&lt;BR /&gt;By breaking apart date, you can get just the %H field and subtract 3.  And if negative, you can  get the %d field and subtract 1 and add 24 to the %H field.  You may need to use printf(1) to make sure each field is two digits.&lt;BR /&gt;&lt;BR /&gt;And more checks for beginning of the month and year.</description>
      <pubDate>Mon, 20 Nov 2006 16:49:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-questions/m-p/5014957#M427270</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2006-11-20T16:49:34Z</dc:date>
    </item>
    <item>
      <title>Re: Script Questions</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-questions/m-p/5014958#M427271</link>
      <description>Hi (again) Andre:&lt;BR /&gt;&lt;BR /&gt;OK, let's create a tiny script that you can modify and 'cron':&lt;BR /&gt;&lt;BR /&gt;# cat .findit&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;typeset REF=/tmp/myref&lt;BR /&gt;touch ${REF}&lt;BR /&gt;perl -e '$t=time()-(60*60*3);utime($t,$t,@ARGV)' ${REF}&lt;BR /&gt;find /path -xdev -type f -newer ${REF}&lt;BR /&gt;exit 0&lt;BR /&gt;&lt;BR /&gt;...This script creates a "referenece" file named by ${REF}.  A Perl snippet is used to set the file's modification and access time to some number of hours ago from the current time.  I used 3-hours in the code.  The reference file is then used in a 'find'.&lt;BR /&gt;&lt;BR /&gt;If you want to run this automatically every &lt;BR /&gt;hours, make a crontab entry like:&lt;BR /&gt;&lt;BR /&gt;0 0,3,6,9,12,15,18,21 * * * /home/andre/findit &lt;BR /&gt;&lt;BR /&gt;This will run your script every thre hours beginning at midnight.  See the manpages for 'crontab' for more information.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 20 Nov 2006 16:56:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-questions/m-p/5014958#M427271</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-11-20T16:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: Script Questions</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-questions/m-p/5014959#M427272</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;use an appropriate TZ variable for a changed timezone for this purpose:&lt;BR /&gt;Actual timezone: TZ=MET-1&lt;BR /&gt;Three hours before: TZ=XXX2  (-1 + 3)&lt;BR /&gt;&lt;BR /&gt;Create a reference file via&lt;BR /&gt;touch -m -t $(TZ=XXX2 date +%m%d%H%M) /tmp/myref&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Mon, 20 Nov 2006 17:06:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-questions/m-p/5014959#M427272</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2006-11-20T17:06:23Z</dc:date>
    </item>
    <item>
      <title>Re: Script Questions</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-questions/m-p/5014960#M427273</link>
      <description>Thank you gentleman for the help so far.  I have to work on something else prior to leaving for the day.  I will try these out in the morning and come back to assign points.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks as always&lt;BR /&gt;&lt;BR /&gt;Andre'</description>
      <pubDate>Mon, 20 Nov 2006 17:06:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-questions/m-p/5014960#M427273</guid>
      <dc:creator>Andre Lemon</dc:creator>
      <dc:date>2006-11-20T17:06:49Z</dc:date>
    </item>
    <item>
      <title>Re: Script Questions</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-questions/m-p/5014961#M427274</link>
      <description>In these threads someone always points out that HPUX (and unix in general) does not remember the 'create date'. That said, for the question on hand teh last modified time will work fine for that.&lt;BR /&gt;&lt;BR /&gt;If you are comfortabel trying perl, then check out its '-M ' file function:&lt;BR /&gt;&lt;BR /&gt; -M  Script start time minus file modification time, in days.&lt;BR /&gt;&lt;BR /&gt;Add to that a 'glob' and you might be in business:&lt;BR /&gt;&lt;BR /&gt;perl -e "while (&amp;lt;*.txt&amp;gt;) { print "$_\n" if 3/24 &amp;gt; -M }"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;hth,&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 20 Nov 2006 21:49:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-questions/m-p/5014961#M427274</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2006-11-20T21:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: Script Questions</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-questions/m-p/5014962#M427275</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;you can also use the "at" command inside your script to re-schedule itself after it has executed.&lt;BR /&gt;&lt;BR /&gt;e.g.&lt;BR /&gt;echo "&lt;YOUR_SCRIPT&gt; /dev/null  &lt;BR /&gt;&lt;BR /&gt;see "man at" for more details.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;kind regards&lt;BR /&gt;yogeeraj&lt;/YOUR_SCRIPT&gt;</description>
      <pubDate>Tue, 21 Nov 2006 00:02:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-questions/m-p/5014962#M427275</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2006-11-21T00:02:39Z</dc:date>
    </item>
    <item>
      <title>Re: Script Questions</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-questions/m-p/5014963#M427276</link>
      <description>&amp;gt;Yogeeraj: you can also use the "at" command inside your script to re-schedule itself&lt;BR /&gt;echo "&lt;YOUR_SCRIPT&gt; /dev/null &lt;BR /&gt;&lt;BR /&gt;A better way would to just use the -f option and give a relative time:&lt;BR /&gt;   at -f /path-to/your-script.ksh +2 hours &amp;gt; /dev/null&lt;/YOUR_SCRIPT&gt;</description>
      <pubDate>Tue, 21 Nov 2006 01:13:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-questions/m-p/5014963#M427276</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2006-11-21T01:13:35Z</dc:date>
    </item>
    <item>
      <title>Re: Script Questions</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-questions/m-p/5014964#M427277</link>
      <description>Thank you all for your help.  I have learned some new ways of doing things.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks a bunch.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Andre'</description>
      <pubDate>Wed, 22 Nov 2006 09:21:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-questions/m-p/5014964#M427277</guid>
      <dc:creator>Andre Lemon</dc:creator>
      <dc:date>2006-11-22T09:21:58Z</dc:date>
    </item>
  </channel>
</rss>

