<?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 removing files older than 10 days in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/removing-files-older-than-10-days/m-p/3954712#M97867</link>
    <description>hi all&lt;BR /&gt;&lt;BR /&gt;we have a directory that the client dumps many reports into daily but its variable day by day (hundreds to few).  to save space, they want me to keep only files that have been created in the last 7 days and delete&lt;BR /&gt;everything else in that directory.&lt;BR /&gt;&lt;BR /&gt;here is the command i have:&lt;BR /&gt;find /col1ap01/metafile/metarprt/completed -type f -mtime +7 -exec|xargs rm &lt;BR /&gt;&lt;BR /&gt;is that look ok or is there a better way&lt;BR /&gt;u mite know of?&lt;BR /&gt;&lt;BR /&gt;thx in advance&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Fri, 02 Mar 2007 11:34:45 GMT</pubDate>
    <dc:creator>p7</dc:creator>
    <dc:date>2007-03-02T11:34:45Z</dc:date>
    <item>
      <title>removing files older than 10 days</title>
      <link>https://community.hpe.com/t5/operating-system-linux/removing-files-older-than-10-days/m-p/3954712#M97867</link>
      <description>hi all&lt;BR /&gt;&lt;BR /&gt;we have a directory that the client dumps many reports into daily but its variable day by day (hundreds to few).  to save space, they want me to keep only files that have been created in the last 7 days and delete&lt;BR /&gt;everything else in that directory.&lt;BR /&gt;&lt;BR /&gt;here is the command i have:&lt;BR /&gt;find /col1ap01/metafile/metarprt/completed -type f -mtime +7 -exec|xargs rm &lt;BR /&gt;&lt;BR /&gt;is that look ok or is there a better way&lt;BR /&gt;u mite know of?&lt;BR /&gt;&lt;BR /&gt;thx in advance&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 02 Mar 2007 11:34:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/removing-files-older-than-10-days/m-p/3954712#M97867</guid>
      <dc:creator>p7</dc:creator>
      <dc:date>2007-03-02T11:34:45Z</dc:date>
    </item>
    <item>
      <title>Re: removing files older than 10 days</title>
      <link>https://community.hpe.com/t5/operating-system-linux/removing-files-older-than-10-days/m-p/3954713#M97868</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Drop the '-exec' since you are passing the stream onto 'xargs'.&lt;BR /&gt;&lt;BR /&gt;# find /col1ap01/metafile/metarprt/completed -type f -mtime +7 | xargs rm&lt;BR /&gt;&lt;BR /&gt;Also, there is no such thing as a "creation" date in Unix. Thc closest you get is the last 'modification" timestamp ('mtime') which will coincidently equal a creation point at the moment of creation.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 02 Mar 2007 11:46:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/removing-files-older-than-10-days/m-p/3954713#M97868</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-03-02T11:46:11Z</dc:date>
    </item>
    <item>
      <title>Re: removing files older than 10 days</title>
      <link>https://community.hpe.com/t5/operating-system-linux/removing-files-older-than-10-days/m-p/3954714#M97869</link>
      <description>Why do you even  need xargs ? I dont believe that can be efficient than using exec&lt;BR /&gt;&lt;BR /&gt;# find /col1ap01/metafile/metarprt/completed -type f -mtime +7 -exec rm {} \;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 02 Mar 2007 13:45:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/removing-files-older-than-10-days/m-p/3954714#M97869</guid>
      <dc:creator>Sundar_7</dc:creator>
      <dc:date>2007-03-02T13:45:28Z</dc:date>
    </item>
    <item>
      <title>Re: removing files older than 10 days</title>
      <link>https://community.hpe.com/t5/operating-system-linux/removing-files-older-than-10-days/m-p/3954715#M97870</link>
      <description>Actually xargs is MORE efficient than the '-exec' option in find.&lt;BR /&gt;&lt;BR /&gt;The '-exec' option will spawn a separate process for each rm to remove each file.  xargs works with groups of files, so you don't spawn as many processes.</description>
      <pubDate>Fri, 02 Mar 2007 14:11:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/removing-files-older-than-10-days/m-p/3954715#M97870</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2007-03-02T14:11:48Z</dc:date>
    </item>
    <item>
      <title>Re: removing files older than 10 days</title>
      <link>https://community.hpe.com/t5/operating-system-linux/removing-files-older-than-10-days/m-p/3954716#M97871</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Patrick noted, "Actually xargs is MORE efficient than the '-exec' option in find."&lt;BR /&gt;&lt;BR /&gt;However, if you are running 11i *and* you use '-exec command \+' instead of '-exec command \;' then the '-exec' collects multiple arguments much in the fashion of 'xargs' leading to a vast improvement in performance!&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 02 Mar 2007 14:17:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/removing-files-older-than-10-days/m-p/3954716#M97871</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-03-02T14:17:48Z</dc:date>
    </item>
  </channel>
</rss>

