<?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: find command returns error if it cant find file in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-returns-error-if-it-cant-find-file/m-p/5174160#M458599</link>
    <description>&amp;gt;find /dir/*dump/*.trc -mtime +14 -exec rm {} + 2&amp;gt; /dev/null&lt;BR /&gt;&lt;BR /&gt;You may also want to improve it by finding only files "-type f" and/or adding "-f" or "-rf" to your rm:&lt;BR /&gt;find /dir/*dump/*.trc -mtime +14 -exec rm -rf {} + 2&amp;gt; /dev/null&lt;BR /&gt;</description>
    <pubDate>Sat, 09 May 2009 19:35:32 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2009-05-09T19:35:32Z</dc:date>
    <item>
      <title>find command returns error if it cant find file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-returns-error-if-it-cant-find-file/m-p/5174157#M458596</link>
      <description>I have a cron that does some cleanup:&lt;BR /&gt;00 5 * * * find /dir/*dump/*.trc -mtime +14 -exec rm {} \;&lt;BR /&gt;&lt;BR /&gt;Which is fine, but find complains if the directory is not there. Which in some cases it wont be.&lt;BR /&gt;&lt;BR /&gt;produced the following output:&lt;BR /&gt;&lt;BR /&gt;find: stat() error/dir/*dump/*.trc: No such file or directory&lt;BR /&gt;&lt;BR /&gt;How do I run this find command in my cron, and not produce an error if it /dir/*dump/ does not exist?&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sat, 09 May 2009 14:27:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-command-returns-error-if-it-cant-find-file/m-p/5174157#M458596</guid>
      <dc:creator>Ratzie</dc:creator>
      <dc:date>2009-05-09T14:27:49Z</dc:date>
    </item>
    <item>
      <title>Re: find command returns error if it cant find file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-returns-error-if-it-cant-find-file/m-p/5174158#M458597</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;# 00 5 * * * find /dir/*dump/*.trc -mtime +14 -exec rm {} \; 2&amp;gt; /dev/null&lt;BR /&gt;&lt;BR /&gt;...will suppress the STDERR output you are seeing.&lt;BR /&gt;&lt;BR /&gt;TO make your removal faster.  The '-exec' terminated with a semicolon will spawn a process for every file found.  Using the '+' terminator causes the bundling of many arguments (here, file names) together and then creating one or just a few processes to remove them.&lt;BR /&gt;&lt;BR /&gt;# 00 5 * * * find /dir/*dump/*.trc -mtime +14 -exec rm {} + 2&amp;gt; /dev/null&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sat, 09 May 2009 14:45:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-command-returns-error-if-it-cant-find-file/m-p/5174158#M458597</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-05-09T14:45:49Z</dc:date>
    </item>
    <item>
      <title>Re: find command returns error if it cant find file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-returns-error-if-it-cant-find-file/m-p/5174159#M458598</link>
      <description>&lt;!--!*#--&gt;&amp;gt; How do I run this find command [...]&lt;BR /&gt;&lt;BR /&gt;You don't.  You run something better.  (Write&lt;BR /&gt;a script which does what you want?)&lt;BR /&gt;&lt;BR /&gt;You could test for the directory/ies before&lt;BR /&gt;running the "find" command.&lt;BR /&gt;&lt;BR /&gt;If a "/dir/*dump" was always there, but the&lt;BR /&gt;"*.trc" part was uncertain, then you might&lt;BR /&gt;do something like:&lt;BR /&gt;&lt;BR /&gt;      find /dir/*dump -name '*.trc'&lt;BR /&gt;&lt;BR /&gt;Using a file-spec wildcard in a "find"&lt;BR /&gt;command is often a sign of a poor design.</description>
      <pubDate>Sat, 09 May 2009 18:08:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-command-returns-error-if-it-cant-find-file/m-p/5174159#M458598</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2009-05-09T18:08:23Z</dc:date>
    </item>
    <item>
      <title>Re: find command returns error if it cant find file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-returns-error-if-it-cant-find-file/m-p/5174160#M458599</link>
      <description>&amp;gt;find /dir/*dump/*.trc -mtime +14 -exec rm {} + 2&amp;gt; /dev/null&lt;BR /&gt;&lt;BR /&gt;You may also want to improve it by finding only files "-type f" and/or adding "-f" or "-rf" to your rm:&lt;BR /&gt;find /dir/*dump/*.trc -mtime +14 -exec rm -rf {} + 2&amp;gt; /dev/null&lt;BR /&gt;</description>
      <pubDate>Sat, 09 May 2009 19:35:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-command-returns-error-if-it-cant-find-file/m-p/5174160#M458599</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-05-09T19:35:32Z</dc:date>
    </item>
    <item>
      <title>Re: find command returns error if it cant find file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-returns-error-if-it-cant-find-file/m-p/5174161#M458600</link>
      <description>worked like a charm! Thanks!</description>
      <pubDate>Sat, 09 May 2009 23:27:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-command-returns-error-if-it-cant-find-file/m-p/5174161#M458600</guid>
      <dc:creator>Ratzie</dc:creator>
      <dc:date>2009-05-09T23:27:08Z</dc:date>
    </item>
  </channel>
</rss>

