<?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: Copy directory tree in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/copy-directory-tree/m-p/2559987#M918293</link>
    <description>Hi Chris&lt;BR /&gt;&lt;BR /&gt;cd /test/dir1/subd1.1&lt;BR /&gt;cp -pr subd1.1/* /test/dir2&lt;BR /&gt;&lt;BR /&gt;Manoj Srivastava</description>
    <pubDate>Wed, 01 Aug 2001 14:45:03 GMT</pubDate>
    <dc:creator>MANOJ SRIVASTAVA</dc:creator>
    <dc:date>2001-08-01T14:45:03Z</dc:date>
    <item>
      <title>Copy directory tree</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/copy-directory-tree/m-p/2559981#M918287</link>
      <description>I have the following example directory structure;&lt;BR /&gt;&lt;BR /&gt;/test/dir1/subd1.1/file&lt;BR /&gt;&lt;BR /&gt;I would like to end up with /test/dir1 and everything below copying (retaining permissions and ownership) and being named as a tree called /test/dir2.  Thus ending up with;&lt;BR /&gt;&lt;BR /&gt;/test/dir1/subd1.1/file&lt;BR /&gt;&amp;amp;&lt;BR /&gt;/test/dir2/subd1.1/file&lt;BR /&gt;&lt;BR /&gt;So I thought something like;&lt;BR /&gt; &lt;BR /&gt;cp -pr /test/dir1 /test/dir2, but I end up with;&lt;BR /&gt;&lt;BR /&gt;/test/dir2/dir1/subd1/file, not what I wanted.&lt;BR /&gt;&lt;BR /&gt;Any ideas?&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;Chris&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 01 Aug 2001 14:17:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/copy-directory-tree/m-p/2559981#M918287</guid>
      <dc:creator>Chris Watson</dc:creator>
      <dc:date>2001-08-01T14:17:48Z</dc:date>
    </item>
    <item>
      <title>Re: Copy directory tree</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/copy-directory-tree/m-p/2559982#M918288</link>
      <description>Hi Chris:&lt;BR /&gt;&lt;BR /&gt;'cp' is the hard-way to do what you want!  Try this:&lt;BR /&gt;&lt;BR /&gt;# cd /test/dir1&lt;BR /&gt;# find . | cpio -pudlmv /test/dir2&lt;BR /&gt;&lt;BR /&gt;See the man pages for the 'cpio' options!&lt;BR /&gt;&lt;BR /&gt;...JRF... &lt;BR /&gt;</description>
      <pubDate>Wed, 01 Aug 2001 14:26:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/copy-directory-tree/m-p/2559982#M918288</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-08-01T14:26:08Z</dc:date>
    </item>
    <item>
      <title>Re: Copy directory tree</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/copy-directory-tree/m-p/2559983#M918289</link>
      <description>Hio Chris:&lt;BR /&gt;&lt;BR /&gt;Try something like this:&lt;BR /&gt;&lt;BR /&gt;mkdir /test/dir2&lt;BR /&gt;(set ownership and permission of this directory as desired using chown, chmod)&lt;BR /&gt;&lt;BR /&gt;cd /test/dir1&lt;BR /&gt;find subd1.1 -print | cpio -pudvm /test/dir2/&lt;BR /&gt;&lt;BR /&gt;Clay &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 01 Aug 2001 14:26:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/copy-directory-tree/m-p/2559983#M918289</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2001-08-01T14:26:11Z</dc:date>
    </item>
    <item>
      <title>Re: Copy directory tree</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/copy-directory-tree/m-p/2559984#M918290</link>
      <description>Well I might have tried:&lt;BR /&gt;&lt;BR /&gt;cp -pr /test/dir1/subd1.1/*  /test/dir2&lt;BR /&gt;&lt;BR /&gt;Just a thought,&lt;BR /&gt;Rita</description>
      <pubDate>Wed, 01 Aug 2001 14:26:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/copy-directory-tree/m-p/2559984#M918290</guid>
      <dc:creator>Rita C Workman</dc:creator>
      <dc:date>2001-08-01T14:26:18Z</dc:date>
    </item>
    <item>
      <title>Re: Copy directory tree</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/copy-directory-tree/m-p/2559985#M918291</link>
      <description>cp -R /dir/tree/dir/tree /dir2/tree&lt;BR /&gt;&lt;BR /&gt;The -R should do it, otherwise create a tar&lt;BR /&gt;from the tree you wish to keep&lt;BR /&gt;&lt;BR /&gt;cd /mydir/tree&lt;BR /&gt;tar -cvf tree.tar tree&lt;BR /&gt;cd /newdir&lt;BR /&gt;tar -xvf tree.tar&lt;BR /&gt;&lt;BR /&gt;Later,&lt;BR /&gt;Bill</description>
      <pubDate>Wed, 01 Aug 2001 14:27:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/copy-directory-tree/m-p/2559985#M918291</guid>
      <dc:creator>Bill McNAMARA_1</dc:creator>
      <dc:date>2001-08-01T14:27:54Z</dc:date>
    </item>
    <item>
      <title>Re: Copy directory tree</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/copy-directory-tree/m-p/2559986#M918292</link>
      <description>mkdir /test/dir2&lt;BR /&gt;cd /test/dir1 &lt;BR /&gt;find . -depth -print | cpio -pdumv /test/dir2&lt;BR /&gt;  &lt;BR /&gt;</description>
      <pubDate>Wed, 01 Aug 2001 14:32:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/copy-directory-tree/m-p/2559986#M918292</guid>
      <dc:creator>Eileen Millen</dc:creator>
      <dc:date>2001-08-01T14:32:11Z</dc:date>
    </item>
    <item>
      <title>Re: Copy directory tree</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/copy-directory-tree/m-p/2559987#M918293</link>
      <description>Hi Chris&lt;BR /&gt;&lt;BR /&gt;cd /test/dir1/subd1.1&lt;BR /&gt;cp -pr subd1.1/* /test/dir2&lt;BR /&gt;&lt;BR /&gt;Manoj Srivastava</description>
      <pubDate>Wed, 01 Aug 2001 14:45:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/copy-directory-tree/m-p/2559987#M918293</guid>
      <dc:creator>MANOJ SRIVASTAVA</dc:creator>
      <dc:date>2001-08-01T14:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: Copy directory tree</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/copy-directory-tree/m-p/2559988#M918294</link>
      <description>HI,&lt;BR /&gt;&lt;BR /&gt;mkdir /test/dir2&lt;BR /&gt;cp -pR /test/dir1/* /test/dir2&lt;BR /&gt;&lt;BR /&gt;and a "chown"on /test/dir2 to get the same permissions as on dir1</description>
      <pubDate>Wed, 01 Aug 2001 14:50:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/copy-directory-tree/m-p/2559988#M918294</guid>
      <dc:creator>Mark van Hassel</dc:creator>
      <dc:date>2001-08-01T14:50:45Z</dc:date>
    </item>
    <item>
      <title>Re: Copy directory tree</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/copy-directory-tree/m-p/2559989#M918295</link>
      <description>Chris,&lt;BR /&gt;&lt;BR /&gt;many cp-solutions, but only two cpio ones.&lt;BR /&gt;But cpio is the better one, because of the correct handling of sym-links.&lt;BR /&gt;&lt;BR /&gt;See this sample (c being a copy of a instead of b):&lt;BR /&gt;&lt;BR /&gt;# touch a&lt;BR /&gt;# ln -s a b&lt;BR /&gt;# ll ?&lt;BR /&gt;-rw-rw-rw-   1 root       sys              0 Aug  1 18:12 a&lt;BR /&gt;lrwxrwxrwx   1 root       sys              1 Aug  1 18:12 b -&amp;gt; a&lt;BR /&gt;# cp -p b c&lt;BR /&gt;# ll ?&lt;BR /&gt;-rw-rw-rw-   1 root       sys              0 Aug  1 18:12 a&lt;BR /&gt;lrwxrwxrwx   1 root       sys              1 Aug  1 18:12 b -&amp;gt; a&lt;BR /&gt;-rw-rw-rw-   1 root       sys              0 Aug  1 18:12 c&lt;BR /&gt;# &lt;BR /&gt;&lt;BR /&gt;Hope this helps&lt;BR /&gt;Volker</description>
      <pubDate>Wed, 01 Aug 2001 15:13:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/copy-directory-tree/m-p/2559989#M918295</guid>
      <dc:creator>Volker Borowski</dc:creator>
      <dc:date>2001-08-01T15:13:01Z</dc:date>
    </item>
    <item>
      <title>Re: Copy directory tree</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/copy-directory-tree/m-p/2559990#M918296</link>
      <description>your test directory already existed, so it created your structure below it..you could use you same copy command if you just delete the current dir2 and allow the cp -rp command to create if for you. &lt;BR /&gt;but as everyone stated, the best way is with find and cpio.</description>
      <pubDate>Wed, 01 Aug 2001 15:16:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/copy-directory-tree/m-p/2559990#M918296</guid>
      <dc:creator>Kevin Wright</dc:creator>
      <dc:date>2001-08-01T15:16:25Z</dc:date>
    </item>
    <item>
      <title>Re: Copy directory tree</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/copy-directory-tree/m-p/2559991#M918297</link>
      <description>Try..&lt;BR /&gt;#cd /test&lt;BR /&gt;#mkdir test2&lt;BR /&gt;#cd /test/dir1&lt;BR /&gt;#cp -Rp . /test/dir2&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;Prashant.</description>
      <pubDate>Wed, 01 Aug 2001 15:22:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/copy-directory-tree/m-p/2559991#M918297</guid>
      <dc:creator>Deshpande Prashant</dc:creator>
      <dc:date>2001-08-01T15:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: Copy directory tree</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/copy-directory-tree/m-p/2559992#M918298</link>
      <description>Thanks to everyone for your replies, of which there are to many to thank individually.&lt;BR /&gt;&lt;BR /&gt;I have ended up with;&lt;BR /&gt;&lt;BR /&gt;cd /test&lt;BR /&gt;cp -pr dir1/. dir2&lt;BR /&gt;&lt;BR /&gt;which does the trick.&lt;BR /&gt;&lt;BR /&gt;Thanks yall.&lt;BR /&gt;&lt;BR /&gt;Chris&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 01 Aug 2001 15:31:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/copy-directory-tree/m-p/2559992#M918298</guid>
      <dc:creator>Chris Watson</dc:creator>
      <dc:date>2001-08-01T15:31:26Z</dc:date>
    </item>
    <item>
      <title>Re: Copy directory tree</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/copy-directory-tree/m-p/2559993#M918299</link>
      <description>Manoj,&lt;BR /&gt;&lt;BR /&gt;I based my usage of your suggestion but modified the source to &lt;BR /&gt;&lt;BR /&gt;cp -pr dir1/. dir2 &lt;BR /&gt;&lt;BR /&gt;As with an asterix it complained of too many files in my production usage.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;Chris&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 01 Aug 2001 15:38:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/copy-directory-tree/m-p/2559993#M918299</guid>
      <dc:creator>Chris Watson</dc:creator>
      <dc:date>2001-08-01T15:38:00Z</dc:date>
    </item>
    <item>
      <title>Re: Copy directory tree</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/copy-directory-tree/m-p/2559994#M918300</link>
      <description>Im new to HP. Ive done this several times on Solaris and have used   &lt;BR /&gt;&lt;BR /&gt;cd to target_dir&lt;BR /&gt;&lt;BR /&gt;find /path/source_dir -depth -print |cpio -pvdum .&lt;BR /&gt;&lt;BR /&gt;I know this has already been suggested.....&lt;BR /&gt;good luck&lt;BR /&gt;</description>
      <pubDate>Wed, 01 Aug 2001 15:56:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/copy-directory-tree/m-p/2559994#M918300</guid>
      <dc:creator>dennis bergman</dc:creator>
      <dc:date>2001-08-01T15:56:24Z</dc:date>
    </item>
    <item>
      <title>Re: Copy directory tree</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/copy-directory-tree/m-p/2559995#M918301</link>
      <description>This way for tar:&lt;BR /&gt;&lt;BR /&gt;mkdir /test/dir2; cd /test/dir1;tar cpf - . | ( cd /test/dir2; tar xpf - )&lt;BR /&gt;&lt;BR /&gt;A million ways to skin a cat!!!&lt;BR /&gt;&lt;BR /&gt;...jcd... &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 01 Aug 2001 16:55:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/copy-directory-tree/m-p/2559995#M918301</guid>
      <dc:creator>Joseph C. Denman</dc:creator>
      <dc:date>2001-08-01T16:55:00Z</dc:date>
    </item>
    <item>
      <title>Re: Copy directory tree</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/copy-directory-tree/m-p/2559996#M918302</link>
      <description>Try to use "rdist", &lt;BR /&gt;it does everything you want to do.</description>
      <pubDate>Wed, 01 Aug 2001 23:42:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/copy-directory-tree/m-p/2559996#M918302</guid>
      <dc:creator>VARITRONIX</dc:creator>
      <dc:date>2001-08-01T23:42:24Z</dc:date>
    </item>
  </channel>
</rss>

