<?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: Automatic File Removal script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/automatic-file-removal-script/m-p/2776421#M76104</link>
    <description>hi,&lt;BR /&gt;find &lt;FILE system=""&gt; -type f -mtime +5  -exec  rm {} \;&lt;BR /&gt;&lt;BR /&gt;here if u say 5 it deletes files which are modified exactly 5 days back, if us say +5 it deletes files modified 5 or more days back, and -5 deletes files which are modified during last 5 days. here mtime modification time, u can also specify atime (accessed time) there.&lt;BR /&gt;type f indicates it is a file.&lt;BR /&gt;&lt;BR /&gt;regds&lt;/FILE&gt;</description>
    <pubDate>Wed, 31 Jul 2002 09:37:29 GMT</pubDate>
    <dc:creator>V. V. Ravi Kumar_1</dc:creator>
    <dc:date>2002-07-31T09:37:29Z</dc:date>
    <item>
      <title>Automatic File Removal script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/automatic-file-removal-script/m-p/2776417#M76100</link>
      <description>I have a daily routine to delete a five day's old file (Oracle archive log). Can you give a me sample script that will delete a five day's old file.&lt;BR /&gt;&lt;BR /&gt;Many thank's</description>
      <pubDate>Wed, 31 Jul 2002 09:15:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/automatic-file-removal-script/m-p/2776417#M76100</guid>
      <dc:creator>Joseph Bague</dc:creator>
      <dc:date>2002-07-31T09:15:22Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic File Removal script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/automatic-file-removal-script/m-p/2776418#M76101</link>
      <description>using find&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;find . \! -mtime 5 -exec rm -f {} \;&lt;BR /&gt;&lt;BR /&gt;test first!</description>
      <pubDate>Wed, 31 Jul 2002 09:17:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/automatic-file-removal-script/m-p/2776418#M76101</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2002-07-31T09:17:50Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic File Removal script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/automatic-file-removal-script/m-p/2776419#M76102</link>
      <description>We always use;&lt;BR /&gt;cd &lt;DIR to="" cleanup=""&gt;&lt;BR /&gt;find . -mtime +&lt;DAYS&gt; -exec rm {} \;&lt;BR /&gt;&lt;BR /&gt;The +&lt;DAYS&gt; is usually +7 or +14 for one or two weeks or +30 for a month. Im not sure what the earlier reply using find . \! -mtime does!?&lt;BR /&gt;&lt;/DAYS&gt;&lt;/DAYS&gt;&lt;/DIR&gt;</description>
      <pubDate>Wed, 31 Jul 2002 09:24:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/automatic-file-removal-script/m-p/2776419#M76102</guid>
      <dc:creator>Stefan Farrelly</dc:creator>
      <dc:date>2002-07-31T09:24:08Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic File Removal script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/automatic-file-removal-script/m-p/2776420#M76103</link>
      <description>\! -mtime 7&lt;BR /&gt;=&lt;BR /&gt;-mtime +7&lt;BR /&gt;&lt;BR /&gt;but older (read very old) find versions do not support + notation&lt;BR /&gt;&lt;BR /&gt;exclamation mark is 'not' or 'reverse' and is escaped for (t)csh users&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;&lt;BR /&gt;BTW GNU find has many more nifty features</description>
      <pubDate>Wed, 31 Jul 2002 09:35:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/automatic-file-removal-script/m-p/2776420#M76103</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2002-07-31T09:35:43Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic File Removal script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/automatic-file-removal-script/m-p/2776421#M76104</link>
      <description>hi,&lt;BR /&gt;find &lt;FILE system=""&gt; -type f -mtime +5  -exec  rm {} \;&lt;BR /&gt;&lt;BR /&gt;here if u say 5 it deletes files which are modified exactly 5 days back, if us say +5 it deletes files modified 5 or more days back, and -5 deletes files which are modified during last 5 days. here mtime modification time, u can also specify atime (accessed time) there.&lt;BR /&gt;type f indicates it is a file.&lt;BR /&gt;&lt;BR /&gt;regds&lt;/FILE&gt;</description>
      <pubDate>Wed, 31 Jul 2002 09:37:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/automatic-file-removal-script/m-p/2776421#M76104</guid>
      <dc:creator>V. V. Ravi Kumar_1</dc:creator>
      <dc:date>2002-07-31T09:37:29Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic File Removal script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/automatic-file-removal-script/m-p/2776422#M76105</link>
      <description>You need to be very careful with these, to make sure that your don't start using variables which may be empty, and which may effectively rm -R / (trust me - I've done it ;-) &lt;BR /&gt;&lt;BR /&gt;I would use something like:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;find /your/log/path -name "*log" -mtime 5 | xargs rm&lt;BR /&gt;&lt;BR /&gt;The xargs is a bit better on performance than find/exec. The use of a full path means you won't remove anything from another path, and the -name part again limits what you will be deleteing.&lt;BR /&gt;&lt;BR /&gt;Cheers!&lt;BR /&gt;James&lt;BR /&gt;</description>
      <pubDate>Wed, 31 Jul 2002 09:41:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/automatic-file-removal-script/m-p/2776422#M76105</guid>
      <dc:creator>James Beamish-White</dc:creator>
      <dc:date>2002-07-31T09:41:37Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic File Removal script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/automatic-file-removal-script/m-p/2776423#M76106</link>
      <description>Just because I saw people before making mistakes in the find path... you might want to specify a name pattern for the archive logs... e.g.&lt;BR /&gt;find /ORACLE_ARCH_DIR -mtime +5 -name "ora_arch*" -type f -exec rm -f {} \;&lt;BR /&gt;In UNIX you have to make sure you protect yourself from making mistakes else the results can be catastrophic...&lt;BR /&gt;George</description>
      <pubDate>Wed, 31 Jul 2002 10:02:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/automatic-file-removal-script/m-p/2776423#M76106</guid>
      <dc:creator>George Petrides_1</dc:creator>
      <dc:date>2002-07-31T10:02:52Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic File Removal script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/automatic-file-removal-script/m-p/2776424#M76107</link>
      <description>Here's is a scripts we run on a monthly basis.&lt;BR /&gt;1st it prints the list of file we're about to delete, then run the deletion.&lt;BR /&gt;We delete files with different patterns.&lt;BR /&gt;See attachment&lt;BR /&gt;&lt;BR /&gt;Jean-Luc</description>
      <pubDate>Wed, 31 Jul 2002 10:17:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/automatic-file-removal-script/m-p/2776424#M76107</guid>
      <dc:creator>Jean-Luc Oudart</dc:creator>
      <dc:date>2002-07-31T10:17:04Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic File Removal script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/automatic-file-removal-script/m-p/2776425#M76108</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Some of proposed solutions are simple but realy dangerous. Removal of old files sometimes can be very tricky. There are 2 MUST rules for any script or program performing cleanup of filesystem&lt;BR /&gt;&lt;BR /&gt;1. Do not follow symlinks in the directories (even if it is the top  level directory for cleaning).&lt;BR /&gt;&lt;BR /&gt;2. Remove only regular files and EMPTY directories.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Personally I prefer to use a 'tmpwatch' program which comes with many versions of RedHat Linux. Source code is available on Redhat web site.&lt;BR /&gt;The source is tested to compile and work correctly on&lt;BR /&gt;HP-UX  as well.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Vytas.</description>
      <pubDate>Thu, 01 Aug 2002 21:50:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/automatic-file-removal-script/m-p/2776425#M76108</guid>
      <dc:creator>Vytautas Vysniauskas</dc:creator>
      <dc:date>2002-08-01T21:50:44Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic File Removal script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/automatic-file-removal-script/m-p/2776426#M76109</link>
      <description>Thank's to every one :)</description>
      <pubDate>Fri, 02 Aug 2002 01:42:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/automatic-file-removal-script/m-p/2776426#M76109</guid>
      <dc:creator>Joseph Bague</dc:creator>
      <dc:date>2002-08-02T01:42:15Z</dc:date>
    </item>
  </channel>
</rss>

