<?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: Question about deleting files by date in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/question-about-deleting-files-by-date/m-p/3565915#M227310</link>
    <description>Kevin,&lt;BR /&gt;rm does not have a option for this.&lt;BR /&gt;My suggestions would be to use find -newer&lt;BR /&gt;You can then use the exec part to remove the files.&lt;BR /&gt;man find  should get you started.&lt;BR /&gt;Regards</description>
    <pubDate>Fri, 17 Jun 2005 06:37:43 GMT</pubDate>
    <dc:creator>Peter Godron</dc:creator>
    <dc:date>2005-06-17T06:37:43Z</dc:date>
    <item>
      <title>Question about deleting files by date</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/question-about-deleting-files-by-date/m-p/3565914#M227309</link>
      <description>Hello, I'm looking for the syntax with rm to remove all files in a directory older than a specific date. Any help is appreciated.&lt;BR /&gt;&lt;BR /&gt;Thanks, Kevin</description>
      <pubDate>Fri, 17 Jun 2005 06:34:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/question-about-deleting-files-by-date/m-p/3565914#M227309</guid>
      <dc:creator>Kevin Farrell_4</dc:creator>
      <dc:date>2005-06-17T06:34:45Z</dc:date>
    </item>
    <item>
      <title>Re: Question about deleting files by date</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/question-about-deleting-files-by-date/m-p/3565915#M227310</link>
      <description>Kevin,&lt;BR /&gt;rm does not have a option for this.&lt;BR /&gt;My suggestions would be to use find -newer&lt;BR /&gt;You can then use the exec part to remove the files.&lt;BR /&gt;man find  should get you started.&lt;BR /&gt;Regards</description>
      <pubDate>Fri, 17 Jun 2005 06:37:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/question-about-deleting-files-by-date/m-p/3565915#M227310</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2005-06-17T06:37:43Z</dc:date>
    </item>
    <item>
      <title>Re: Question about deleting files by date</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/question-about-deleting-files-by-date/m-p/3565916#M227311</link>
      <description>Or you can use other find options like -mtime:&lt;BR /&gt;&lt;BR /&gt;find /start_dir -type f -mtime +10 |xargs rm&lt;BR /&gt;&lt;BR /&gt;There are good examples in the find man page.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Fri, 17 Jun 2005 06:43:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/question-about-deleting-files-by-date/m-p/3565916#M227311</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2005-06-17T06:43:49Z</dc:date>
    </item>
    <item>
      <title>Re: Question about deleting files by date</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/question-about-deleting-files-by-date/m-p/3565917#M227312</link>
      <description>You can do with find command as,&lt;BR /&gt;&lt;BR /&gt;touch &lt;TIMESTAMP&gt; &lt;DIRECTORY&gt;/filecheck&lt;BR /&gt;&lt;BR /&gt;find &lt;DIRECTORY&gt; -type f -newer filecheck -exec rm -i {} \;&lt;BR /&gt;&lt;BR /&gt;or you can use,&lt;BR /&gt;&lt;BR /&gt;find &lt;DIRECTORY&gt; -type f -mtime -10 | xargs rm -f &lt;BR /&gt;&lt;BR /&gt;-mtime is used to check modified time over 10 days.&lt;BR /&gt;&lt;BR /&gt;hth.&lt;BR /&gt;&lt;/DIRECTORY&gt;&lt;/DIRECTORY&gt;&lt;/DIRECTORY&gt;&lt;/TIMESTAMP&gt;</description>
      <pubDate>Fri, 17 Jun 2005 06:44:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/question-about-deleting-files-by-date/m-p/3565917#M227312</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-06-17T06:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: Question about deleting files by date</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/question-about-deleting-files-by-date/m-p/3565918#M227313</link>
      <description>What will the find command do? I need to delete them. The problem is this. Oracle Concurrent manager files. There is a program to delete the old logs, based upon number of days old. Say, delete all logs and clean concurrent manager table for all requests older than 20 days. However the log deleting portion doesn't work. &lt;BR /&gt;&lt;BR /&gt;I can't work with the directory on FTP. Reflections just goes kaput. So there is no way in unix to delete files in a directory older than a certain date? I need to keep some of the files so users can view past logs of past requests, otherwise I'd just blow away the whole directory and recreate it.&lt;BR /&gt;&lt;BR /&gt;Kevin</description>
      <pubDate>Fri, 17 Jun 2005 07:10:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/question-about-deleting-files-by-date/m-p/3565918#M227313</guid>
      <dc:creator>Kevin Farrell_4</dc:creator>
      <dc:date>2005-06-17T07:10:19Z</dc:date>
    </item>
    <item>
      <title>Re: Question about deleting files by date</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/question-about-deleting-files-by-date/m-p/3565919#M227314</link>
      <description>As mentioned, find is the command to locate files by last modification date. An alternate way to run find (instead of xargs) is to use -exec as in:&lt;BR /&gt; &lt;BR /&gt;find /someplace -type f -mtime -10 -exec rm {} \;&lt;BR /&gt; &lt;BR /&gt;HOWEVER: if you run this command as root, you have the ability (with a spelling error) to destroy all files in the entire computer!! As an example, if you accdently type / someplace rather than /someplace (see the extra space?) then find locates all files in the / directory--on every mountpoint--in every directory--including NFS! So always run a test command by using echo first:&lt;BR /&gt; &lt;BR /&gt;find /someplace -type f -mtime -10 -exec echo rm {} \;&lt;BR /&gt; &lt;BR /&gt;Also, the default behavior for find is to descend into all subdirectories. If you're cleaning out a flat directory, no problem. Or if you are cleaning out everything in all subdirectories, the above is still OK. But if  you don't want to pickup anything in sub-directories, you need to do two things: add the -only option (which prevents looking at any directories), and add the * after your pathname:&lt;BR /&gt; &lt;BR /&gt;find /someplace/* -only -type f -mtime -10 -exec echo rm {} \;&lt;BR /&gt; &lt;BR /&gt;-only is not quite as simple as it would seem. When find is given a directory name, the first test is on that starting directory (not the contents) and -only says "don't look in any directories" - including this one). So to get rid of files in a specific directory, you have to give find the list of files to examine. As with all shells, /&lt;PATH&gt;/* will be expanded into all the filenames in /&lt;PATH&gt;.&lt;/PATH&gt;&lt;/PATH&gt;</description>
      <pubDate>Fri, 17 Jun 2005 07:11:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/question-about-deleting-files-by-date/m-p/3565919#M227314</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2005-06-17T07:11:02Z</dc:date>
    </item>
    <item>
      <title>Re: Question about deleting files by date</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/question-about-deleting-files-by-date/m-p/3565920#M227315</link>
      <description>Kevin,&lt;BR /&gt;as Bill above explains :&lt;BR /&gt;find - finds the files&lt;BR /&gt;exec rm or xargs - removes the files&lt;BR /&gt;&lt;BR /&gt;Regards</description>
      <pubDate>Mon, 20 Jun 2005 03:15:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/question-about-deleting-files-by-date/m-p/3565920#M227315</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2005-06-20T03:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: Question about deleting files by date</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/question-about-deleting-files-by-date/m-p/3565921#M227316</link>
      <description>hi kevin,&lt;BR /&gt;&lt;BR /&gt;as the rest has mentioned, use the find command. besides the concurrent (log) logs, take note of the Oracle output (out) files as well, it grows very fast as well.&lt;BR /&gt;&lt;BR /&gt;# find &lt;DIR of="" files="" to="" delete=""&gt; -mtime +&lt;NO. of="" days=""&gt; -exec rm {} \; &lt;BR /&gt;&lt;BR /&gt;u may like to write a script which deletes these files and run it as a cron.&lt;BR /&gt;&lt;BR /&gt;also, last thing, u may also like to assign points to show your appreciation to those who have assisted u in finding your answers. 0 out of 28 (and counting) is not good.&lt;BR /&gt;&lt;BR /&gt;regards.&lt;/NO.&gt;&lt;/DIR&gt;</description>
      <pubDate>Mon, 20 Jun 2005 03:40:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/question-about-deleting-files-by-date/m-p/3565921#M227316</guid>
      <dc:creator>Joseph Loo</dc:creator>
      <dc:date>2005-06-20T03:40:52Z</dc:date>
    </item>
  </channel>
</rss>

