<?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 problem in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/find-problem/m-p/4990240#M422033</link>
    <description>Thx to all of you ... figured out everything to this problem</description>
    <pubDate>Tue, 11 Jul 2006 15:58:59 GMT</pubDate>
    <dc:creator>Hunki</dc:creator>
    <dc:date>2006-07-11T15:58:59Z</dc:date>
    <item>
      <title>find problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-problem/m-p/4990232#M422025</link>
      <description>I have to do a find and then move over the files to a different directory ... &lt;BR /&gt;&lt;BR /&gt;from /log to /log/bak&lt;BR /&gt;&lt;BR /&gt;Which piece am I missing here :&lt;BR /&gt;&lt;BR /&gt;find /log -type f -name "*.gz" -mtime -1 -exec mv{} /log/bak&lt;BR /&gt;&lt;BR /&gt;Also once they are moved the log files to /log/bak I have recreate them in order to record the logs :&lt;BR /&gt;&lt;BR /&gt;is this a gud way :&lt;BR /&gt;&lt;BR /&gt;for files in /log&lt;BR /&gt;do &lt;BR /&gt;touch $i&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Can there be a better way here. &lt;BR /&gt;&lt;BR /&gt;Thx!</description>
      <pubDate>Tue, 11 Jul 2006 15:34:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-problem/m-p/4990232#M422025</guid>
      <dc:creator>Hunki</dc:creator>
      <dc:date>2006-07-11T15:34:28Z</dc:date>
    </item>
    <item>
      <title>Re: find problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-problem/m-p/4990233#M422026</link>
      <description>This should work:&lt;BR /&gt;find /log -type f -name "*.gz" -mtime -1 -exec mv{} /log/bak \; &lt;BR /&gt;&lt;BR /&gt;Think your only missing the \; piece to it.&lt;BR /&gt;</description>
      <pubDate>Tue, 11 Jul 2006 15:37:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-problem/m-p/4990233#M422026</guid>
      <dc:creator>Dave Hutton</dc:creator>
      <dc:date>2006-07-11T15:37:54Z</dc:date>
    </item>
    <item>
      <title>Re: find problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-problem/m-p/4990234#M422027</link>
      <description>It still says incomplete statement...</description>
      <pubDate>Tue, 11 Jul 2006 15:39:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-problem/m-p/4990234#M422027</guid>
      <dc:creator>Hunki</dc:creator>
      <dc:date>2006-07-11T15:39:44Z</dc:date>
    </item>
    <item>
      <title>Re: find problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-problem/m-p/4990235#M422028</link>
      <description>You'll get a generic message if /log/bak isn't there.  Also I'm assuming off of / really want those files under there.  Hopefully you'll never fill it up with some large old log files and up causing bigger issues.&lt;BR /&gt;&lt;BR /&gt;Heres how I tested it:&lt;BR /&gt;servera:root /home/dahmin/dahtemp # ll&lt;BR /&gt;total 16&lt;BR /&gt;drwxr-xr-x   2 root       sys             96 Jul 11 15:50 .&lt;BR /&gt;drwxr-xr-x   4 dahmin     users         8192 Jul 11 15:51 ..&lt;BR /&gt;-rw-r--r--   1 root       sys              0 Jul 11 15:50 dahtest&lt;BR /&gt;servera:root /home/dahmin/dahtemp # cd ..&lt;BR /&gt;servera:root /home/dahmin # ll&lt;BR /&gt;total 176&lt;BR /&gt;drwxr-xr-x   4 dahmin     users         8192 Jul 11 15:51 .&lt;BR /&gt;drwxr-xr-x  13 root       root          8192 Jun 14 12:08 ..&lt;BR /&gt;-rw-------   1 dahmin     users            0 Sep 30  2005 .ICEauthority&lt;BR /&gt;-rw-------   1 dahmin     users           73 Sep 30  2005 .TTauthority&lt;BR /&gt;-rw-------   1 dahmin     users           49 Sep 30  2005 .Xauthority&lt;BR /&gt;-r--r--r--   1 dahmin     users          814 Nov  7  1997 .cshrc&lt;BR /&gt;drwxr-xr-x  11 dahmin     users         8192 Sep 30  2005 .dt&lt;BR /&gt;-rwxr-xr-x   1 dahmin     users         5451 Sep 30  2005 .dtprofile&lt;BR /&gt;-r--r--r--   1 dahmin     users          347 Oct 27  1997 .exrc&lt;BR /&gt;-r--r--r--   1 dahmin     users          341 Nov  7  1997 .login&lt;BR /&gt;-rw-r--r--   1 dahmin     users          446 Sep 21  2005 .profile&lt;BR /&gt;-rw-------   1 dahmin     users         1906 Jul 10 10:24 .sh_history&lt;BR /&gt;drwxr-xr-x   2 root       sys             96 Jul 11 15:50 dahtemp&lt;BR /&gt;-rw-r--r--   1 root       sys              0 Jul 11 15:51 davefile&lt;BR /&gt;servera:root /home/dahmin # find . -name *davefile* -exec mv {} ./dahtemp \;&lt;BR /&gt;servera:root /home/dahmin # cd dahtemp&lt;BR /&gt;servera:root /home/dahmin/dahtemp # ll&lt;BR /&gt;total 16&lt;BR /&gt;drwxr-xr-x   2 root       sys             96 Jul 11 15:52 .&lt;BR /&gt;drwxr-xr-x   4 dahmin     users         8192 Jul 11 15:52 ..&lt;BR /&gt;-rw-r--r--   1 root       sys              0 Jul 11 15:50 dahtest&lt;BR /&gt;-rw-r--r--   1 root       sys              0 Jul 11 15:51 davefile&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 11 Jul 2006 15:43:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-problem/m-p/4990235#M422028</guid>
      <dc:creator>Dave Hutton</dc:creator>
      <dc:date>2006-07-11T15:43:38Z</dc:date>
    </item>
    <item>
      <title>Re: find problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-problem/m-p/4990236#M422029</link>
      <description>if you are having problems with exec construct and can not figure out where it is coming from, you can try to divide the problem into two as follows:&lt;BR /&gt;&lt;BR /&gt;find /log -type f -name "*.gz" -mtime -1 &amp;gt;/tmp/filelist&lt;BR /&gt;for file in `cat /tmp/filelist`&lt;BR /&gt;do&lt;BR /&gt;mv $file /log/bak&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Hope it helps`</description>
      <pubDate>Tue, 11 Jul 2006 15:50:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-problem/m-p/4990236#M422029</guid>
      <dc:creator>Mel Burslan</dc:creator>
      <dc:date>2006-07-11T15:50:31Z</dc:date>
    </item>
    <item>
      <title>Re: find problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-problem/m-p/4990237#M422030</link>
      <description>be careful with syntax recommended and the specific directories you list...&lt;BR /&gt;&lt;BR /&gt;if your source files are in /log and your destination is in /log/bak, then the find command you list will also find the files in your destination directory, and either create errors or worse, destroy the files when it tries to move them into the same filename.&lt;BR /&gt;&lt;BR /&gt;you'll want to use someting like:&lt;BR /&gt;find /log -type f -path "/log/*.gz" \&lt;BR /&gt;  -mtime -1 -exec mv {} /log/bak \;&lt;BR /&gt;(all on one line)&lt;BR /&gt;&lt;BR /&gt;note the "-path" instead of "-name" will only find files in /log but not in subdirectories.&lt;BR /&gt;</description>
      <pubDate>Tue, 11 Jul 2006 15:51:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-problem/m-p/4990237#M422030</guid>
      <dc:creator>Greg Vaidman</dc:creator>
      <dc:date>2006-07-11T15:51:23Z</dc:date>
    </item>
    <item>
      <title>Re: find problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-problem/m-p/4990238#M422031</link>
      <description>How do I create the empty log files that have been moved to bak...</description>
      <pubDate>Tue, 11 Jul 2006 15:51:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-problem/m-p/4990238#M422031</guid>
      <dc:creator>Hunki</dc:creator>
      <dc:date>2006-07-11T15:51:59Z</dc:date>
    </item>
    <item>
      <title>Re: find problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-problem/m-p/4990239#M422032</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Your original post:&lt;BR /&gt;&lt;BR /&gt;# find /log -type f -name "*.gz" -mtime -1 -exec mv{} /log/bak&lt;BR /&gt;&lt;BR /&gt;...has *no* whitespace between 'mv' and the opening curly brace.  It needs that! :&lt;BR /&gt;&lt;BR /&gt;find /log -type f -name "*.gz" -mtime -1 -exec mv {} /log/bak&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Tue, 11 Jul 2006 15:55:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-problem/m-p/4990239#M422032</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-07-11T15:55:08Z</dc:date>
    </item>
    <item>
      <title>Re: find problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-problem/m-p/4990240#M422033</link>
      <description>Thx to all of you ... figured out everything to this problem</description>
      <pubDate>Tue, 11 Jul 2006 15:58:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-problem/m-p/4990240#M422033</guid>
      <dc:creator>Hunki</dc:creator>
      <dc:date>2006-07-11T15:58:59Z</dc:date>
    </item>
  </channel>
</rss>

