<?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: file cleanup in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/file-cleanup/m-p/2625231#M39700</link>
    <description>Hi:&lt;BR /&gt;&lt;BR /&gt;You can do this with 'find'.  'touch' a reference file and then search for files that are older than it:&lt;BR /&gt;&lt;BR /&gt;cd &lt;YOURDIR&gt;&lt;BR /&gt;# touch -m -t 12041300 myref&lt;BR /&gt;# find . -type f  ! -newer /tmp/ref -exec rm -i {} \;&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;/YOURDIR&gt;</description>
    <pubDate>Tue, 04 Dec 2001 19:55:32 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2001-12-04T19:55:32Z</dc:date>
    <item>
      <title>file cleanup</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-cleanup/m-p/2625230#M39699</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;How do I remove/delete files older than 1 hour or last modified was 1 hour ago?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance</description>
      <pubDate>Tue, 04 Dec 2001 19:43:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-cleanup/m-p/2625230#M39699</guid>
      <dc:creator>Ridzuan Zakaria</dc:creator>
      <dc:date>2001-12-04T19:43:38Z</dc:date>
    </item>
    <item>
      <title>Re: file cleanup</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-cleanup/m-p/2625231#M39700</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;You can do this with 'find'.  'touch' a reference file and then search for files that are older than it:&lt;BR /&gt;&lt;BR /&gt;cd &lt;YOURDIR&gt;&lt;BR /&gt;# touch -m -t 12041300 myref&lt;BR /&gt;# find . -type f  ! -newer /tmp/ref -exec rm -i {} \;&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;/YOURDIR&gt;</description>
      <pubDate>Tue, 04 Dec 2001 19:55:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-cleanup/m-p/2625231#M39700</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-12-04T19:55:32Z</dc:date>
    </item>
    <item>
      <title>Re: file cleanup</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-cleanup/m-p/2625232#M39701</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;I have a Perl utility fileage.pl which can tell if a file has been accessed, modified, or changed in a period of time.&lt;BR /&gt;&lt;BR /&gt;Here is one approach:&lt;BR /&gt;&lt;BR /&gt;cd to desired directory:&lt;BR /&gt;find . -type f -print | while read X&lt;BR /&gt;do&lt;BR /&gt;  fileage.pl -m 3600 ${X}&lt;BR /&gt;  STAT1=$?&lt;BR /&gt;  fileage.pl -c 3600 ${X}&lt;BR /&gt;  STAT2=$?&lt;BR /&gt;  if [ ${STAT1} -eq 0 -a ${STAT2} -eq 0 ]&lt;BR /&gt;    then&lt;BR /&gt;      echo "File ${X} Has not been modified in \c"&lt;BR /&gt;      echo "3600 seconds"&lt;BR /&gt;#     rm -f ${X}"&lt;BR /&gt;    fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Fileage.pl returns 0 if the file has not been modified and 1 if it has. Simply invoke fileage.pl without arguments for full usage. Note: The rm is commented out. Test first.&lt;BR /&gt;&lt;BR /&gt;Regards, Clay</description>
      <pubDate>Tue, 04 Dec 2001 19:58:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-cleanup/m-p/2625232#M39701</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2001-12-04T19:58:30Z</dc:date>
    </item>
    <item>
      <title>Re: file cleanup</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-cleanup/m-p/2625233#M39702</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;linux has the find . -cmin n optio, hp does not, create a referention file every hour and,&lt;BR /&gt;&lt;BR /&gt;find . -newer file -exec rm {}\;&lt;BR /&gt;&lt;BR /&gt;Hope this will help,&lt;BR /&gt;&lt;BR /&gt;Gideon</description>
      <pubDate>Tue, 04 Dec 2001 19:59:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-cleanup/m-p/2625233#M39702</guid>
      <dc:creator>G. Vrijhoeven</dc:creator>
      <dc:date>2001-12-04T19:59:00Z</dc:date>
    </item>
    <item>
      <title>Re: file cleanup</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-cleanup/m-p/2625234#M39703</link>
      <description>Ooops, the remove line should not have a trailing "&lt;BR /&gt;&lt;BR /&gt;should be:&lt;BR /&gt;rm -f ${X} &lt;BR /&gt;</description>
      <pubDate>Tue, 04 Dec 2001 20:04:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-cleanup/m-p/2625234#M39703</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2001-12-04T20:04:46Z</dc:date>
    </item>
    <item>
      <title>Re: file cleanup</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-cleanup/m-p/2625235#M39704</link>
      <description>Thanks guys.</description>
      <pubDate>Tue, 04 Dec 2001 20:05:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-cleanup/m-p/2625235#M39704</guid>
      <dc:creator>Ridzuan Zakaria</dc:creator>
      <dc:date>2001-12-04T20:05:08Z</dc:date>
    </item>
    <item>
      <title>Re: file cleanup</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-cleanup/m-p/2625236#M39705</link>
      <description>You could try the following:&lt;BR /&gt;&lt;BR /&gt;BASEFILE=/tmp/dummyfile&lt;BR /&gt;HERE=/path/to/directory/to/start/from&lt;BR /&gt;now=`date +%m%d%H%M`&lt;BR /&gt;hourago=`expr $dt - 100`&lt;BR /&gt;touch -t $hourago $BASEFILE&lt;BR /&gt;cd $HERE&lt;BR /&gt;find . -type f ! -newer $BASEFILE -exec rm {} \;&lt;BR /&gt;&lt;BR /&gt;(note that you can replace rm with ls to list the files rather than delete them)&lt;BR /&gt;&lt;BR /&gt;good luck.</description>
      <pubDate>Tue, 04 Dec 2001 20:10:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-cleanup/m-p/2625236#M39705</guid>
      <dc:creator>Kofi ARTHIABAH</dc:creator>
      <dc:date>2001-12-04T20:10:22Z</dc:date>
    </item>
    <item>
      <title>Re: file cleanup</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-cleanup/m-p/2625237#M39706</link>
      <description>Oooooppsss... in my last post, it should be now rather than dt:&lt;BR /&gt;&lt;BR /&gt;hourago=`expr $now - 100` &lt;BR /&gt;</description>
      <pubDate>Tue, 04 Dec 2001 20:12:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-cleanup/m-p/2625237#M39706</guid>
      <dc:creator>Kofi ARTHIABAH</dc:creator>
      <dc:date>2001-12-04T20:12:22Z</dc:date>
    </item>
  </channel>
</rss>

