<?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: Move files older than 3 hours to archive directory in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/move-files-older-than-3-hours-to-archive-directory/m-p/2743383#M944105</link>
    <description>Just a thought:&lt;BR /&gt;&lt;BR /&gt;You may consider using '-newer' option with find command. Touch a file and find the more recently modified files.&lt;BR /&gt;&lt;BR /&gt;# man find (for details)</description>
    <pubDate>Wed, 12 Jun 2002 20:42:04 GMT</pubDate>
    <dc:creator>Helen French</dc:creator>
    <dc:date>2002-06-12T20:42:04Z</dc:date>
    <item>
      <title>Move files older than 3 hours to archive directory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/move-files-older-than-3-hours-to-archive-directory/m-p/2743381#M944103</link>
      <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;I was wondering if there is an easy way to do this ... I need to move log files older than 3 hours to the archive directory, for now I've a written a script (runs every 4 hours in cron) to do that and works okay, but it is not very efficient.&lt;BR /&gt;&lt;BR /&gt;Any help would be greatly appreciated.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Shabu</description>
      <pubDate>Wed, 12 Jun 2002 20:36:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/move-files-older-than-3-hours-to-archive-directory/m-p/2743381#M944103</guid>
      <dc:creator>SHABU KHAN</dc:creator>
      <dc:date>2002-06-12T20:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: Move files older than 3 hours to archive directory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/move-files-older-than-3-hours-to-archive-directory/m-p/2743382#M944104</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Why do you not consider your approach efficient?  Inherently, this has little overhead.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 12 Jun 2002 20:41:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/move-files-older-than-3-hours-to-archive-directory/m-p/2743382#M944104</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2002-06-12T20:41:37Z</dc:date>
    </item>
    <item>
      <title>Re: Move files older than 3 hours to archive directory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/move-files-older-than-3-hours-to-archive-directory/m-p/2743383#M944105</link>
      <description>Just a thought:&lt;BR /&gt;&lt;BR /&gt;You may consider using '-newer' option with find command. Touch a file and find the more recently modified files.&lt;BR /&gt;&lt;BR /&gt;# man find (for details)</description>
      <pubDate>Wed, 12 Jun 2002 20:42:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/move-files-older-than-3-hours-to-archive-directory/m-p/2743383#M944105</guid>
      <dc:creator>Helen French</dc:creator>
      <dc:date>2002-06-12T20:42:04Z</dc:date>
    </item>
    <item>
      <title>Re: Move files older than 3 hours to archive directory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/move-files-older-than-3-hours-to-archive-directory/m-p/2743384#M944106</link>
      <description>Hi Shabu&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;It is good taht you already have a wokring solution . May be run it every 3 hrs instead of 4 hrs , use find with options or &lt;BR /&gt;&lt;BR /&gt;ls -l | awk '{if ($9 &amp;gt; "x" ) print $NF }' print the o/p in a file and use that file as the input to move the files .&lt;BR /&gt;&lt;BR /&gt;You can just increment the value of x by whenever you want to run it .&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Manoj Srivastava</description>
      <pubDate>Wed, 12 Jun 2002 20:56:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/move-files-older-than-3-hours-to-archive-directory/m-p/2743384#M944106</guid>
      <dc:creator>MANOJ SRIVASTAVA</dc:creator>
      <dc:date>2002-06-12T20:56:43Z</dc:date>
    </item>
    <item>
      <title>Re: Move files older than 3 hours to archive directory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/move-files-older-than-3-hours-to-archive-directory/m-p/2743385#M944107</link>
      <description>JRF,&lt;BR /&gt;I can live with the current script but just curious if you guys had a similar requirement ..&lt;BR /&gt;&lt;BR /&gt;Shiju,&lt;BR /&gt;I am aware of the newer file option with find ... and thought about using it, but settled for a different logic ...&lt;BR /&gt;&lt;BR /&gt;Manoj,&lt;BR /&gt;I'll think about your option ...&lt;BR /&gt;&lt;BR /&gt;Thanks Guys !&lt;BR /&gt;-Shabu</description>
      <pubDate>Wed, 12 Jun 2002 21:17:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/move-files-older-than-3-hours-to-archive-directory/m-p/2743385#M944107</guid>
      <dc:creator>SHABU KHAN</dc:creator>
      <dc:date>2002-06-12T21:17:25Z</dc:date>
    </item>
    <item>
      <title>Re: Move files older than 3 hours to archive directory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/move-files-older-than-3-hours-to-archive-directory/m-p/2743386#M944108</link>
      <description>Hello Shabu,&lt;BR /&gt;&lt;BR /&gt;I made 2 script.&lt;BR /&gt;the first calculates the &lt;BR /&gt;time to minutes.&lt;BR /&gt;the second calculates it to&lt;BR /&gt;time again so it can be used&lt;BR /&gt;to by the touch command.&lt;BR /&gt;&lt;BR /&gt;calculate the time in minutes&lt;BR /&gt;minus 180,&lt;BR /&gt;calculated this back to time,&lt;BR /&gt;touch a file with this time,&lt;BR /&gt;move all files that are not&lt;BR /&gt;newer then this file.&lt;BR /&gt;&lt;BR /&gt;I use them for 40 minutes.&lt;BR /&gt;set $(min2date.sh $(expr $(date2min.sh) - 40))&lt;BR /&gt;&lt;BR /&gt;touch -t $1$2$3$4 tempfile&lt;BR /&gt;&lt;BR /&gt;the scripts do NOT work at the start of a new year.&lt;BR /&gt;&lt;BR /&gt;The scripts are attached to &lt;BR /&gt;this message.&lt;BR /&gt;&lt;BR /&gt;when you want, try it.&lt;BR /&gt;&lt;BR /&gt;Regards Gregor</description>
      <pubDate>Thu, 13 Jun 2002 05:52:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/move-files-older-than-3-hours-to-archive-directory/m-p/2743386#M944108</guid>
      <dc:creator>Gregor Weertman</dc:creator>
      <dc:date>2002-06-13T05:52:13Z</dc:date>
    </item>
    <item>
      <title>Re: Move files older than 3 hours to archive directory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/move-files-older-than-3-hours-to-archive-directory/m-p/2743387#M944109</link>
      <description>Since you did not post your script, it is hard to guess what is inefficient about it or/and what can be improved.&lt;BR /&gt;&lt;BR /&gt;In general, it is important to try not to use loops, or, if you have to use them, only/mainly use built-in shell commands in the loop, i.e. no external ones, i.e. not from /usr/bin, etc..&lt;BR /&gt;&lt;BR /&gt;Apparently you are already aware of find(1) and its "-newer" option. I advise to use that and pipe the list of files to be mv(1)-ed  to xargs(1), so xargs(1) can invoke mv(1) multiple files to be moved, instead of just a single one.</description>
      <pubDate>Thu, 13 Jun 2002 12:57:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/move-files-older-than-3-hours-to-archive-directory/m-p/2743387#M944109</guid>
      <dc:creator>Frank Slootweg</dc:creator>
      <dc:date>2002-06-13T12:57:31Z</dc:date>
    </item>
  </channel>
</rss>

