<?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: find content by second in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/find-content-by-second/m-p/4190894#M323645</link>
    <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Use Perl;&lt;BR /&gt;&lt;BR /&gt;This script will find files in the current directory that have been modified within the number of seconds passed as an argument:&lt;BR /&gt;&lt;BR /&gt;# perl -MFile::Find -le '$secs=shift||60;find(sub{print $File::Find::name if -f $_ &amp;amp;&amp;amp; -M _ &amp;lt;= $secs/86400},".")'&lt;BR /&gt;&lt;BR /&gt;By default, 60-seconds is assumed.  To look for files in '/tmp' modified in the last hour, you would do:&lt;BR /&gt;&lt;BR /&gt;# cd /tmp;&lt;BR /&gt;# perl -M...)' 3600&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
    <pubDate>Fri, 02 May 2008 12:37:34 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2008-05-02T12:37:34Z</dc:date>
    <item>
      <title>find content by second</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-content-by-second/m-p/4190893#M323644</link>
      <description>I want to use the command "find" to search the file content in a directory , I know mmin can search by minute , mtime by date , if I want by second , what can I do ? thx</description>
      <pubDate>Fri, 02 May 2008 12:17:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-content-by-second/m-p/4190893#M323644</guid>
      <dc:creator>elainelaw</dc:creator>
      <dc:date>2008-05-02T12:17:21Z</dc:date>
    </item>
    <item>
      <title>Re: find content by second</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-content-by-second/m-p/4190894#M323645</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Use Perl;&lt;BR /&gt;&lt;BR /&gt;This script will find files in the current directory that have been modified within the number of seconds passed as an argument:&lt;BR /&gt;&lt;BR /&gt;# perl -MFile::Find -le '$secs=shift||60;find(sub{print $File::Find::name if -f $_ &amp;amp;&amp;amp; -M _ &amp;lt;= $secs/86400},".")'&lt;BR /&gt;&lt;BR /&gt;By default, 60-seconds is assumed.  To look for files in '/tmp' modified in the last hour, you would do:&lt;BR /&gt;&lt;BR /&gt;# cd /tmp;&lt;BR /&gt;# perl -M...)' 3600&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 02 May 2008 12:37:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-content-by-second/m-p/4190894#M323645</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-05-02T12:37:34Z</dc:date>
    </item>
    <item>
      <title>Re: find content by second</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-content-by-second/m-p/4190895#M323646</link>
      <description>are you really looking for by 1 second ?  Curious what you are going to do as the results would probably take at least another second to act upon.&lt;BR /&gt;&lt;BR /&gt;Any way..&lt;BR /&gt;&lt;BR /&gt;Here is a different twist.&lt;BR /&gt;Have your script create a file. &lt;BR /&gt;Then use find with the -newer option to find all files newer than the file you just created.&lt;BR /&gt;Go to sleep for 1 second&lt;BR /&gt;touch your file again&lt;BR /&gt;then find again.&lt;BR /&gt;&lt;BR /&gt;e.g.&lt;BR /&gt;while true &lt;BR /&gt;do&lt;BR /&gt;&amp;gt; control.file&lt;BR /&gt;find ./ -newer control.file&lt;BR /&gt;sleep 1&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;I would expect this script to chow up CPU and disk resources depending on the size of the directory your are searching, and again, if it takes more than a second to do the search then output will be irrelevant.  Maybe sleep 10 is better ?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 02 May 2008 12:47:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-content-by-second/m-p/4190895#M323646</guid>
      <dc:creator>Tim Nelson</dc:creator>
      <dc:date>2008-05-02T12:47:15Z</dc:date>
    </item>
    <item>
      <title>Re: find content by second</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-content-by-second/m-p/4190896#M323647</link>
      <description>The reason that I want to do it is I would like to write a script to find a word "error" in a directory regularly ( some new files will write to this directory from time to time ) , then send the mail to administrator to report which file contain the word "error" , but I want the administrator should only receive the same file name one time , that means if the script found the same file have the word "error" , it do not send the report to administrator again for the same file name ) ,   my method is run a crontab job script ( find -name "error" , then send mail ...)  in every 2 hours , to prevent the checking mistake if the checking and file generation are at the same time , so I want to change my  script to ( find -name "error" -time 2880+5 , then send mail...) , can advise how to make use the script provided ?&lt;BR /&gt;&lt;BR /&gt;# perl -MFile::Find -le '$secs=shift||60;find(sub{print $File::Find::name if -f $_ &amp;amp;&amp;amp; -M _ &amp;lt;= $secs/86400},".")'&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;ps.&lt;BR /&gt;2 Hr = 2880 second</description>
      <pubDate>Mon, 05 May 2008 09:00:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-content-by-second/m-p/4190896#M323647</guid>
      <dc:creator>haeman</dc:creator>
      <dc:date>2008-05-05T09:00:48Z</dc:date>
    </item>
    <item>
      <title>Re: find content by second</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-content-by-second/m-p/4190897#M323648</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;There is no mmin option with the find in HP-UX.&lt;BR /&gt;&lt;BR /&gt;You mean you will run the cron in every 2 hrs and will send the mail to the admin. So, how come the 1 second requirement. Can you please elaborate your requirement more in detail. &lt;BR /&gt;&lt;BR /&gt;Rgds.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 05 May 2008 11:38:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-content-by-second/m-p/4190897#M323648</guid>
      <dc:creator>Rasheed Tamton</dc:creator>
      <dc:date>2008-05-05T11:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: find content by second</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-content-by-second/m-p/4190898#M323649</link>
      <description>i think i'd be tempted to keep a list of all of the files already transmitted and when the job runs list all of the the files with "error" in them.  &lt;BR /&gt;&lt;BR /&gt;Transmit the difference in the lists and update the transmitted list.  &lt;BR /&gt;&lt;BR /&gt;Initialization of the "transmitted" list, and when this should be done are left as an excercise....</description>
      <pubDate>Mon, 05 May 2008 12:41:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-content-by-second/m-p/4190898#M323649</guid>
      <dc:creator>OldSchool</dc:creator>
      <dc:date>2008-05-05T12:41:13Z</dc:date>
    </item>
  </channel>
</rss>

