<?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: Linux script for purging old files in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/linux-script-for-purging-old-files/m-p/5120872#M49895</link>
    <description>Use rm -fvr, adding the "-v" will display the name. Redirect the ouput to a file with "&amp;gt; filename".</description>
    <pubDate>Tue, 22 Jul 2008 18:21:04 GMT</pubDate>
    <dc:creator>Ivan Ferreira</dc:creator>
    <dc:date>2008-07-22T18:21:04Z</dc:date>
    <item>
      <title>Linux script for purging old files</title>
      <link>https://community.hpe.com/t5/operating-system-linux/linux-script-for-purging-old-files/m-p/5120869#M49892</link>
      <description>Greetings,&lt;BR /&gt;&lt;BR /&gt;I am looking for help on writing a script to purge files that are older than 14 days.  I am currently running RHAS 4.0&lt;BR /&gt;&lt;BR /&gt;Please help.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Jorge</description>
      <pubDate>Tue, 22 Jul 2008 16:55:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/linux-script-for-purging-old-files/m-p/5120869#M49892</guid>
      <dc:creator>Jorge Cocomess</dc:creator>
      <dc:date>2008-07-22T16:55:43Z</dc:date>
    </item>
    <item>
      <title>Re: Linux script for purging old files</title>
      <link>https://community.hpe.com/t5/operating-system-linux/linux-script-for-purging-old-files/m-p/5120870#M49893</link>
      <description>You can use find:&lt;BR /&gt;find some-path... -mtime +14 -exec rm -rf \;&lt;BR /&gt;&lt;BR /&gt;Make sure you test it first by inserting the echo command before "rm".</description>
      <pubDate>Tue, 22 Jul 2008 17:55:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/linux-script-for-purging-old-files/m-p/5120870#M49893</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-07-22T17:55:59Z</dc:date>
    </item>
    <item>
      <title>Re: Linux script for purging old files</title>
      <link>https://community.hpe.com/t5/operating-system-linux/linux-script-for-purging-old-files/m-p/5120871#M49894</link>
      <description>How would I or how I should retain a list of purged files?&lt;BR /&gt;&lt;BR /&gt;Thanks!</description>
      <pubDate>Tue, 22 Jul 2008 18:01:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/linux-script-for-purging-old-files/m-p/5120871#M49894</guid>
      <dc:creator>Jorge Cocomess</dc:creator>
      <dc:date>2008-07-22T18:01:07Z</dc:date>
    </item>
    <item>
      <title>Re: Linux script for purging old files</title>
      <link>https://community.hpe.com/t5/operating-system-linux/linux-script-for-purging-old-files/m-p/5120872#M49895</link>
      <description>Use rm -fvr, adding the "-v" will display the name. Redirect the ouput to a file with "&amp;gt; filename".</description>
      <pubDate>Tue, 22 Jul 2008 18:21:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/linux-script-for-purging-old-files/m-p/5120872#M49895</guid>
      <dc:creator>Ivan Ferreira</dc:creator>
      <dc:date>2008-07-22T18:21:04Z</dc:date>
    </item>
    <item>
      <title>Re: Linux script for purging old files</title>
      <link>https://community.hpe.com/t5/operating-system-linux/linux-script-for-purging-old-files/m-p/5120873#M49896</link>
      <description>Okay...&lt;BR /&gt;&lt;BR /&gt;So, the codes should look like this?&lt;BR /&gt;&lt;BR /&gt;cd /tmp/log_files&lt;BR /&gt;find . -type -f -mtime 2 -name "*.log*" -exec rm -fvr &amp;gt; /tmp/purged.log {} \;&lt;BR /&gt;&lt;BR /&gt;Thanks much!!&lt;BR /&gt;&lt;BR /&gt;Jorge&lt;BR /&gt;</description>
      <pubDate>Tue, 22 Jul 2008 19:31:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/linux-script-for-purging-old-files/m-p/5120873#M49896</guid>
      <dc:creator>Jorge Cocomess</dc:creator>
      <dc:date>2008-07-22T19:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: Linux script for purging old files</title>
      <link>https://community.hpe.com/t5/operating-system-linux/linux-script-for-purging-old-files/m-p/5120874#M49897</link>
      <description>I need help with my script.  I am very novice and still learning on how to write Linux scripts at this time.  There are two (2) issues with what I am trying to do.&lt;BR /&gt;&lt;BR /&gt;1.  The script execute but does nothing.  No errors.&lt;BR /&gt;&lt;BR /&gt;2.  I have results if I execute the command from the script manually.  However, it showed that the log captured the removed files, but leaves the supposely removed files back in the original directory.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Here's the sample of my script.&lt;BR /&gt;&lt;BR /&gt;#! /bin/sh&lt;BR /&gt;#&lt;BR /&gt;# Delete files that are older than 7 days&lt;BR /&gt;cd /tmp/datalog/tdump&lt;BR /&gt;find . -type f -mtime 7 -name "*.dlog*" -exec rm -fvr &amp;gt; \tmp\purge.log {} \;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;feedback would greatly appreciate it.&lt;BR /&gt;&lt;BR /&gt;Jorge&lt;BR /&gt;</description>
      <pubDate>Wed, 23 Jul 2008 14:30:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/linux-script-for-purging-old-files/m-p/5120874#M49897</guid>
      <dc:creator>Jorge Cocomess</dc:creator>
      <dc:date>2008-07-23T14:30:13Z</dc:date>
    </item>
    <item>
      <title>Re: Linux script for purging old files</title>
      <link>https://community.hpe.com/t5/operating-system-linux/linux-script-for-purging-old-files/m-p/5120875#M49898</link>
      <description>#! /bin/sh&lt;BR /&gt;#&lt;BR /&gt;# Delete files that are older than 7 days&lt;BR /&gt;cd /tmp/datalog/tdump&lt;BR /&gt;find . -type f -mtime 7 -name "*.dlog*" -exec rm -fvr {} \; &amp;gt; \tmp\purge.log&lt;BR /&gt;</description>
      <pubDate>Wed, 23 Jul 2008 14:46:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/linux-script-for-purging-old-files/m-p/5120875#M49898</guid>
      <dc:creator>Court Campbell</dc:creator>
      <dc:date>2008-07-23T14:46:31Z</dc:date>
    </item>
    <item>
      <title>Re: Linux script for purging old files</title>
      <link>https://community.hpe.com/t5/operating-system-linux/linux-script-for-purging-old-files/m-p/5120876#M49899</link>
      <description>I think I also got the back-slash backward as well.&lt;BR /&gt;find . -type f -mtime 7 -name "*.dlog*" -exec rm -fvr &amp;gt; \tmp\purge.log {} \;&lt;BR /&gt;&lt;BR /&gt;It should be &lt;BR /&gt;find . -type f -mtime 7 -name "*.dlog*" -exec rm -fvr {} \; &amp;gt; /tmp/purge.log&lt;BR /&gt;&lt;BR /&gt;I will test it out and let you all know.&lt;BR /&gt;&lt;BR /&gt;Thanks!!&lt;BR /&gt;</description>
      <pubDate>Wed, 23 Jul 2008 15:03:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/linux-script-for-purging-old-files/m-p/5120876#M49899</guid>
      <dc:creator>Jorge Cocomess</dc:creator>
      <dc:date>2008-07-23T15:03:09Z</dc:date>
    </item>
    <item>
      <title>Re: Linux script for purging old files</title>
      <link>https://community.hpe.com/t5/operating-system-linux/linux-script-for-purging-old-files/m-p/5120877#M49900</link>
      <description>&amp;gt;Delete files that are older than 7 days&lt;BR /&gt;&lt;BR /&gt;Older requires: -mtime +7</description>
      <pubDate>Sat, 26 Jul 2008 03:08:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/linux-script-for-purging-old-files/m-p/5120877#M49900</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-07-26T03:08:43Z</dc:date>
    </item>
    <item>
      <title>Re: Linux script for purging old files</title>
      <link>https://community.hpe.com/t5/operating-system-linux/linux-script-for-purging-old-files/m-p/5120878#M49901</link>
      <description>"Older requires: -mtime +7" - It doesn't work for me.  It will work just fine with -mtime 7.  Beats the heck out of me.&lt;BR /&gt;&lt;BR /&gt;Any ideas??&lt;BR /&gt;&lt;BR /&gt;J</description>
      <pubDate>Thu, 31 Jul 2008 03:46:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/linux-script-for-purging-old-files/m-p/5120878#M49901</guid>
      <dc:creator>Jorge Cocomess</dc:creator>
      <dc:date>2008-07-31T03:46:46Z</dc:date>
    </item>
    <item>
      <title>Re: Linux script for purging old files</title>
      <link>https://community.hpe.com/t5/operating-system-linux/linux-script-for-purging-old-files/m-p/5120879#M49902</link>
      <description>The -ctime, -mtime and -atime options of the find command calculate the file's age by 24-hour periods, ignoring any fractional part.&lt;BR /&gt;&lt;BR /&gt;"-mtime 7" finds files which are _exactly_ 7 days old, i.e. files with ages between [exactly 7 days] and [7 days, 23 hours, 59 minutes and 59 seconds].&lt;BR /&gt;&lt;BR /&gt;"-mtime +7" finds files which are more than 7 full 24-hour periods old, i.e. 8 days old or older. A file that is 7 days, 23 hours, 59 minutes and 59 seconds old is counted as 7 days old, and "more than 7" means 8 days or more.&lt;BR /&gt;&lt;BR /&gt;MK</description>
      <pubDate>Thu, 31 Jul 2008 12:36:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/linux-script-for-purging-old-files/m-p/5120879#M49902</guid>
      <dc:creator>Matti_Kurkela</dc:creator>
      <dc:date>2008-07-31T12:36:04Z</dc:date>
    </item>
    <item>
      <title>Re: Linux script for purging old files</title>
      <link>https://community.hpe.com/t5/operating-system-linux/linux-script-for-purging-old-files/m-p/5120880#M49903</link>
      <description>Much better explainations...Thank you!</description>
      <pubDate>Fri, 01 Aug 2008 02:13:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/linux-script-for-purging-old-files/m-p/5120880#M49903</guid>
      <dc:creator>Jorge Cocomess</dc:creator>
      <dc:date>2008-08-01T02:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: Linux script for purging old files</title>
      <link>https://community.hpe.com/t5/operating-system-linux/linux-script-for-purging-old-files/m-p/5120881#M49904</link>
      <description>Thanks!</description>
      <pubDate>Fri, 01 Aug 2008 02:15:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/linux-script-for-purging-old-files/m-p/5120881#M49904</guid>
      <dc:creator>Jorge Cocomess</dc:creator>
      <dc:date>2008-08-01T02:15:44Z</dc:date>
    </item>
  </channel>
</rss>

