<?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: how to delete files which are olderthan 24 hours in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-delete-files-which-are-olderthan-24-hours/m-p/3416520#M203417</link>
    <description>You can do as,&lt;BR /&gt;&lt;BR /&gt;find &lt;DIRECTORY path=""&gt; -type f -name "&lt;ANYFILE format="" or="" regular="" expression=""&gt;" -mtime +1 -exec rm -i {} \;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;And,&lt;BR /&gt;&lt;BR /&gt;if you are having script then, just change 2 day to 1 day :)&lt;BR /&gt;&lt;BR /&gt;HTH.&lt;/ANYFILE&gt;&lt;/DIRECTORY&gt;</description>
    <pubDate>Sat, 06 Nov 2004 11:02:48 GMT</pubDate>
    <dc:creator>Muthukumar_5</dc:creator>
    <dc:date>2004-11-06T11:02:48Z</dc:date>
    <item>
      <title>how to delete files which are olderthan 24 hours</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-delete-files-which-are-olderthan-24-hours/m-p/3416517#M203414</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;i have a shell script which deletes files which are olderthan 2 days.... how can I change this to delete files which are olderthan one day (24 hours)&lt;BR /&gt;&lt;BR /&gt;i need a shell script to do that... in hpux 11i&lt;BR /&gt;&lt;BR /&gt;thnx in advance...&lt;BR /&gt;&lt;BR /&gt;--ram&lt;BR /&gt;</description>
      <pubDate>Sat, 06 Nov 2004 09:49:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-delete-files-which-are-olderthan-24-hours/m-p/3416517#M203414</guid>
      <dc:creator>ram_26</dc:creator>
      <dc:date>2004-11-06T09:49:26Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete files which are olderthan 24 hours</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-delete-files-which-are-olderthan-24-hours/m-p/3416518#M203415</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;you can try this with a combination of touch and find command.&lt;BR /&gt;&lt;BR /&gt;say the current time is 10 am Nov 6th, touch a file with a timestamp of 10am nov 5th&lt;BR /&gt;&lt;BR /&gt;touch -t 200411051000 /tmp/testfile&lt;BR /&gt;&lt;BR /&gt;Now use this file to ocheck on the timestamp of the other files in the directory where you want to look for files more than 24 hours old.&lt;BR /&gt;&lt;BR /&gt;find /your_dir -type f !-newer /tmp/testfile -exec ll {}\;&lt;BR /&gt;&lt;BR /&gt;to delete these files&lt;BR /&gt;find /your_dir -type f !-newer /tmp/testfile -exec rm {}\;&lt;BR /&gt;&lt;BR /&gt;Hope this helps.&lt;BR /&gt;&lt;BR /&gt;regds&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sat, 06 Nov 2004 10:08:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-delete-files-which-are-olderthan-24-hours/m-p/3416518#M203415</guid>
      <dc:creator>Sanjay_6</dc:creator>
      <dc:date>2004-11-06T10:08:31Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete files which are olderthan 24 hours</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-delete-files-which-are-olderthan-24-hours/m-p/3416519#M203416</link>
      <description>&amp;gt;&amp;gt;  have a shell script which deletes files which are olderthan 2 days.... how can I change this to delete files which are olderthan one day (24 hours)&lt;BR /&gt;&lt;BR /&gt;So why don't you share (attach as txt?) with us the chunk of the script that you suspect selects the files now. &lt;BR /&gt;A reader may be able to adapt the existing script to the new requirement.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;btw... for some quick &amp;amp; dirty cleanup scripts it is enough to just do &lt;BR /&gt;find $target -mtime +1 -exec rm {} \;&lt;BR /&gt;&lt;BR /&gt;Be sure to check 'man find' for the various time selections you can make and details on how to specify older vs newer and so on.&lt;BR /&gt;&lt;BR /&gt;hth,&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sat, 06 Nov 2004 10:20:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-delete-files-which-are-olderthan-24-hours/m-p/3416519#M203416</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2004-11-06T10:20:11Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete files which are olderthan 24 hours</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-delete-files-which-are-olderthan-24-hours/m-p/3416520#M203417</link>
      <description>You can do as,&lt;BR /&gt;&lt;BR /&gt;find &lt;DIRECTORY path=""&gt; -type f -name "&lt;ANYFILE format="" or="" regular="" expression=""&gt;" -mtime +1 -exec rm -i {} \;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;And,&lt;BR /&gt;&lt;BR /&gt;if you are having script then, just change 2 day to 1 day :)&lt;BR /&gt;&lt;BR /&gt;HTH.&lt;/ANYFILE&gt;&lt;/DIRECTORY&gt;</description>
      <pubDate>Sat, 06 Nov 2004 11:02:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-delete-files-which-are-olderthan-24-hours/m-p/3416520#M203417</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2004-11-06T11:02:48Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete files which are olderthan 24 hours</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-delete-files-which-are-olderthan-24-hours/m-p/3416521#M203418</link>
      <description>Hi Ram,&lt;BR /&gt;&lt;BR /&gt;use your script ;-)&lt;BR /&gt;&lt;BR /&gt;example&lt;BR /&gt;&lt;BR /&gt;find /opt/oracle/SID/bdump  -mtime +1 -exec rm{} \; &lt;BR /&gt;&lt;BR /&gt;br Jan&lt;BR /&gt;</description>
      <pubDate>Sun, 07 Nov 2004 01:14:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-delete-files-which-are-olderthan-24-hours/m-p/3416521#M203418</guid>
      <dc:creator>Jan Sladky</dc:creator>
      <dc:date>2004-11-07T01:14:46Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete files which are olderthan 24 hours</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-delete-files-which-are-olderthan-24-hours/m-p/3416522#M203419</link>
      <description>Sanjay gave the wonderful solution, by the way, remember the following command will file under /dir from (the moment - 24hours) you issue the command: &lt;BR /&gt;# find /dir -type f -mtime +1 -exec rm -i {} \;&lt;BR /&gt;</description>
      <pubDate>Sun, 07 Nov 2004 01:31:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-delete-files-which-are-olderthan-24-hours/m-p/3416522#M203419</guid>
      <dc:creator>twang</dc:creator>
      <dc:date>2004-11-07T01:31:59Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete files which are olderthan 24 hours</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-delete-files-which-are-olderthan-24-hours/m-p/3416523#M203420</link>
      <description>hi friends...,&lt;BR /&gt;&lt;BR /&gt;thnx a lot.... for ur help.... one last and small doubt... if i want to delete the files which are olderthan 12 hours how can I do it.....?&lt;BR /&gt;&lt;BR /&gt;thnx in advance...&lt;BR /&gt;&lt;BR /&gt;--ram</description>
      <pubDate>Sun, 07 Nov 2004 04:01:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-delete-files-which-are-olderthan-24-hours/m-p/3416523#M203420</guid>
      <dc:creator>ram_26</dc:creator>
      <dc:date>2004-11-07T04:01:22Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete files which are olderthan 24 hours</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-delete-files-which-are-olderthan-24-hours/m-p/3416524#M203421</link>
      <description>how about the following:&lt;BR /&gt;# touch -t &lt;CURRENT_TIME -="" 12="" hours=""&gt; /tmp/ref&lt;BR /&gt;find . !-newer /tmp/ref -type f -exec rm {}\;&lt;/CURRENT_TIME&gt;</description>
      <pubDate>Sun, 07 Nov 2004 07:19:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-delete-files-which-are-olderthan-24-hours/m-p/3416524#M203421</guid>
      <dc:creator>twang</dc:creator>
      <dc:date>2004-11-07T07:19:51Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete files which are olderthan 24 hours</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-delete-files-which-are-olderthan-24-hours/m-p/3416525#M203422</link>
      <description>The same methods still apply... mostly.&lt;BR /&gt;The find, just with time becomes too coarse.&lt;BR /&gt;The find with -newer become more interesting.&lt;BR /&gt;You may also want to check out the perl -M operator to give an age to work with. The same perl script could do the finding ('glob') and the delete (unlink).&lt;BR /&gt;&lt;BR /&gt;Howeverm, now that you are  talking about such rapid turnaround on your files I'm starting to think this may be about log / trace / eds / temp files for a specific application which needs to be reigned in somewhat.&lt;BR /&gt;&lt;BR /&gt;You may want to consider a build in method versus after the fact cleanup. For example, maybe those files are all created in a specific directory? How about making that directory a softlink to a time-stamped directory? Every hour, on the hour, or every 6 hours, you create a fresh directory and flip the soft-link to point to the new directory. Once that is done you delete the directory that corresponds with the current delete interval you need to maintain.&lt;BR /&gt;Or... you could look at the space used / left and delete older directory untill the space need is acceptable instead of blindly deleting older files whether you need the space or not.&lt;BR /&gt;&lt;BR /&gt;[those directories could have a date+time encoded in the name YYMMDDHHMM, or could just have  numeric sequence number as name.]&lt;BR /&gt;Just thinking out aloud...&lt;BR /&gt;&lt;BR /&gt;hth.&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Sun, 07 Nov 2004 13:10:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-delete-files-which-are-olderthan-24-hours/m-p/3416525#M203422</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2004-11-07T13:10:39Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete files which are olderthan 24 hours</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-delete-files-which-are-olderthan-24-hours/m-p/3416526#M203423</link>
      <description>why you do not use the crontab process by adding a script to run every day&lt;BR /&gt;&lt;BR /&gt;#crontab -e&lt;BR /&gt;* 6 * * * /testscript&lt;BR /&gt;&lt;BR /&gt;and the testscript contant is&lt;BR /&gt;&lt;BR /&gt;find / -atime +1 -exec rm {} \;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 08 Nov 2004 02:34:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-delete-files-which-are-olderthan-24-hours/m-p/3416526#M203423</guid>
      <dc:creator>Fadia Almarei</dc:creator>
      <dc:date>2004-11-08T02:34:07Z</dc:date>
    </item>
  </channel>
</rss>

