<?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: &amp;quot;rm -r `&amp;quot; help in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/quot-rm-r-quot-help/m-p/5104961#M444865</link>
    <description>Hi:&lt;BR /&gt;&lt;BR /&gt;You really want to descend the directory and deal with its contents first.  Hence:&lt;BR /&gt;&lt;BR /&gt;# /usr/bin/find $FPATH -depth -mtime +3 -exec rm -r {} \+ &amp;gt;&amp;gt; /tmp/clean_log 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;Notice the addition of '-depth'.  Notice, too, that I changed the semicolon (;) to a plus (+) character.  This causes find to buffer many arguments together and '-exec' the process passing them as a block.  This avoids spawning one process per file found, greatly improving performance.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 22 Apr 2008 18:58:58 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2008-04-22T18:58:58Z</dc:date>
    <item>
      <title>"rm -r `" help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/quot-rm-r-quot-help/m-p/5104960#M444864</link>
      <description>Hi,&lt;BR /&gt;  I have a cron job running to clean logs old&lt;BR /&gt;than 3 days. There is always some error msg&lt;BR /&gt;in the log. How to get rid of it?&lt;BR /&gt;&lt;BR /&gt;# /usr/bin/find $FPATH -mtime +3 -exec rm -r {} \; &amp;gt;&amp;gt; /tmp/clean_log 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;Example msg in /tmp/clean_log:&lt;BR /&gt;/usr/bin/find: /my-path/xyz: no such file or directory.&lt;BR /&gt;&lt;BR /&gt;The xyz directory already got removed even before removing the files in xyz. Then "rm -r"&lt;BR /&gt;try to remove it again?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance,&lt;BR /&gt;&lt;BR /&gt;IDT&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 22 Apr 2008 18:43:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/quot-rm-r-quot-help/m-p/5104960#M444864</guid>
      <dc:creator>Lucy2009_1</dc:creator>
      <dc:date>2008-04-22T18:43:33Z</dc:date>
    </item>
    <item>
      <title>Re: "rm -r `" help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/quot-rm-r-quot-help/m-p/5104961#M444865</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;You really want to descend the directory and deal with its contents first.  Hence:&lt;BR /&gt;&lt;BR /&gt;# /usr/bin/find $FPATH -depth -mtime +3 -exec rm -r {} \+ &amp;gt;&amp;gt; /tmp/clean_log 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;Notice the addition of '-depth'.  Notice, too, that I changed the semicolon (;) to a plus (+) character.  This causes find to buffer many arguments together and '-exec' the process passing them as a block.  This avoids spawning one process per file found, greatly improving performance.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 22 Apr 2008 18:58:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/quot-rm-r-quot-help/m-p/5104961#M444865</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-04-22T18:58:58Z</dc:date>
    </item>
    <item>
      <title>Re: "rm -r `" help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/quot-rm-r-quot-help/m-p/5104962#M444866</link>
      <description>James,&lt;BR /&gt;  It almost work but it complains:&lt;BR /&gt;find: missing argument to '-exec'&lt;BR /&gt;&lt;BR /&gt;IDT</description>
      <pubDate>Tue, 22 Apr 2008 19:28:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/quot-rm-r-quot-help/m-p/5104962#M444866</guid>
      <dc:creator>Lucy2009_1</dc:creator>
      <dc:date>2008-04-22T19:28:35Z</dc:date>
    </item>
    <item>
      <title>Re: "rm -r `" help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/quot-rm-r-quot-help/m-p/5104963#M444867</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;write a twoliner "/tmp/myrm"&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;rm -r "$@"&lt;BR /&gt;&lt;BR /&gt;and after&lt;BR /&gt;chmod +x /tmp/myrm&lt;BR /&gt;&lt;BR /&gt;use &lt;BR /&gt;find $FPATH -depth -mtime +3 -exec /tmp/myrm {} \+ &amp;gt;&amp;gt; /tmp/clean_log 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Tue, 22 Apr 2008 19:36:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/quot-rm-r-quot-help/m-p/5104963#M444867</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2008-04-22T19:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: "rm -r `" help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/quot-rm-r-quot-help/m-p/5104964#M444868</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; It almost work but it complains:&lt;BR /&gt;find: missing argument to '-exec'&lt;BR /&gt;&lt;BR /&gt;Then, I suspect that you are running a release much earlier than 11.11 or not an HP-UX.  In this case, go back to the use of the semicolon in lieu of the "+", or pipe the 'find' output to 'xargs' to do the buffering.&lt;BR /&gt;&lt;BR /&gt;By the way, since you are recursively removing files and directories, you could also do:&lt;BR /&gt;&lt;BR /&gt;... rm -rf ...&lt;BR /&gt;&lt;BR /&gt;...which has the property of suppressing non-existent file messages.&lt;BR /&gt;&lt;BR /&gt;Beware, that by not specifying FILES (with '-type f') you may be taking DIRECTORIES and the FILES therein that you DON'T want!  That is because any file that is removed from a directory causes the 'mtime' of the *directory* to be updated.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 22 Apr 2008 19:37:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/quot-rm-r-quot-help/m-p/5104964#M444868</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-04-22T19:37:55Z</dc:date>
    </item>
    <item>
      <title>Re: "rm -r `" help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/quot-rm-r-quot-help/m-p/5104965#M444869</link>
      <description>Thanks James &amp;amp; Peter!&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 22 Apr 2008 20:07:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/quot-rm-r-quot-help/m-p/5104965#M444869</guid>
      <dc:creator>Lucy2009_1</dc:creator>
      <dc:date>2008-04-22T20:07:46Z</dc:date>
    </item>
  </channel>
</rss>

