<?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: Recreate exact directory structure in another server in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/recreate-exact-directory-structure-in-another-server/m-p/4103952#M30767</link>
    <description>HI (again) :&lt;BR /&gt;&lt;BR /&gt;Court, thanks, and yes I was aware of the HP-UX port.  I'm a tool-builder for a variety of reasons, not the least of which --- TMTOWTDI.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...   &lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Fri, 16 Nov 2007 12:32:34 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2007-11-16T12:32:34Z</dc:date>
    <item>
      <title>Recreate exact directory structure in another server</title>
      <link>https://community.hpe.com/t5/operating-system-linux/recreate-exact-directory-structure-in-another-server/m-p/4103945#M30760</link>
      <description>Hi&lt;BR /&gt;I like to recreate a directory hierachy structure from one server to another. Is there a script to do this?&lt;BR /&gt;Requirements&lt;BR /&gt;1. Recreated dir must have same permissions, user name and group name&lt;BR /&gt;2. Symbolic links to directory must also be recreated as symbolic links (no deferencing)&lt;BR /&gt;&lt;BR /&gt;I was thinking of using tar together with find. But find command cannot differentiate symbolically linked directories and symbolic linked files&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Fri, 16 Nov 2007 04:06:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/recreate-exact-directory-structure-in-another-server/m-p/4103945#M30760</guid>
      <dc:creator>kenny chia</dc:creator>
      <dc:date>2007-11-16T04:06:46Z</dc:date>
    </item>
    <item>
      <title>Re: Recreate exact directory structure in another server</title>
      <link>https://community.hpe.com/t5/operating-system-linux/recreate-exact-directory-structure-in-another-server/m-p/4103946#M30761</link>
      <description>If you just want to copy the directory structure, and not the files, you can use find with tar or cpio quite easily.&lt;BR /&gt;&lt;BR /&gt;find . ! -type f | cpio -ovH newc &amp;gt; /tmp/dir.structure.cpio&lt;BR /&gt;</description>
      <pubDate>Fri, 16 Nov 2007 04:33:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/recreate-exact-directory-structure-in-another-server/m-p/4103946#M30761</guid>
      <dc:creator>Stuart Browne</dc:creator>
      <dc:date>2007-11-16T04:33:01Z</dc:date>
    </item>
    <item>
      <title>Re: Recreate exact directory structure in another server</title>
      <link>https://community.hpe.com/t5/operating-system-linux/recreate-exact-directory-structure-in-another-server/m-p/4103947#M30762</link>
      <description>Hi&lt;BR /&gt;Thanks, but using &lt;BR /&gt;&lt;BR /&gt;find . ! -type f &lt;BR /&gt;&lt;BR /&gt;will also back up symbolically linked files which I have to exclude&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Fri, 16 Nov 2007 04:36:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/recreate-exact-directory-structure-in-another-server/m-p/4103947#M30762</guid>
      <dc:creator>kenny chia</dc:creator>
      <dc:date>2007-11-16T04:36:15Z</dc:date>
    </item>
    <item>
      <title>Re: Recreate exact directory structure in another server</title>
      <link>https://community.hpe.com/t5/operating-system-linux/recreate-exact-directory-structure-in-another-server/m-p/4103948#M30763</link>
      <description>So you want directories, and symbolic links to directories, but not symbolic links to files?&lt;BR /&gt;&lt;BR /&gt;Ugh, that makes life a bit more difficult because of 2).&lt;BR /&gt;&lt;BR /&gt;Ok, try:&lt;BR /&gt;&lt;BR /&gt;find . ! -type f ! -xtype f | ...</description>
      <pubDate>Fri, 16 Nov 2007 05:08:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/recreate-exact-directory-structure-in-another-server/m-p/4103948#M30763</guid>
      <dc:creator>Stuart Browne</dc:creator>
      <dc:date>2007-11-16T05:08:42Z</dc:date>
    </item>
    <item>
      <title>Re: Recreate exact directory structure in another server</title>
      <link>https://community.hpe.com/t5/operating-system-linux/recreate-exact-directory-structure-in-another-server/m-p/4103949#M30764</link>
      <description>&lt;!--!*#--&gt;Hi Kenny:&lt;BR /&gt;&lt;BR /&gt;Linux/GNU has features that one would like to see in Unix!&lt;BR /&gt;&lt;BR /&gt;An approach other than Stuart's very elegant one is to use Perl:&lt;BR /&gt;&lt;BR /&gt;# cat ./showdir&lt;BR /&gt;#!/usr/bin/perl&lt;BR /&gt;use strict;&lt;BR /&gt;use warnings;&lt;BR /&gt;use File::Find;&lt;BR /&gt;use Cwd qw( realpath );&lt;BR /&gt;my @dir = @ARGV ? @ARGV : ('.');&lt;BR /&gt;find(&lt;BR /&gt;    sub {&lt;BR /&gt;        lstat;&lt;BR /&gt;        my $name = $File::Find::name;&lt;BR /&gt;        if ( -d _ ) { print "d $name\n" }&lt;BR /&gt;        elsif ( -l _ &amp;amp;&amp;amp; -d realpath($name) ) {&lt;BR /&gt;            print "l $name -&amp;gt; ", realpath($name), "\n";&lt;BR /&gt;        }&lt;BR /&gt;    },&lt;BR /&gt;    @dir&lt;BR /&gt;);&lt;BR /&gt;1; #_jrf_&lt;BR /&gt;&lt;BR /&gt;...run as:&lt;BR /&gt;&lt;BR /&gt;# ./showdir /path&lt;BR /&gt;&lt;BR /&gt;For example:&lt;BR /&gt;&lt;BR /&gt;# .showdir /home/jrf&lt;BR /&gt;d /home/jrf&lt;BR /&gt;l /home/jrf/linktotmp -&amp;gt; /tmp&lt;BR /&gt;d /home/jrf/Mail&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 16 Nov 2007 11:38:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/recreate-exact-directory-structure-in-another-server/m-p/4103949#M30764</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-11-16T11:38:19Z</dc:date>
    </item>
    <item>
      <title>Re: Recreate exact directory structure in another server</title>
      <link>https://community.hpe.com/t5/operating-system-linux/recreate-exact-directory-structure-in-another-server/m-p/4103950#M30765</link>
      <description>James,&lt;BR /&gt;&lt;BR /&gt;You may already know about this. But your in luck.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://hpux.cs.utah.edu/hppd/hpux/Gnu/findutils-4.2.31/" target="_blank"&gt;http://hpux.cs.utah.edu/hppd/hpux/Gnu/findutils-4.2.31/&lt;/A&gt;</description>
      <pubDate>Fri, 16 Nov 2007 12:13:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/recreate-exact-directory-structure-in-another-server/m-p/4103950#M30765</guid>
      <dc:creator>Court Campbell</dc:creator>
      <dc:date>2007-11-16T12:13:49Z</dc:date>
    </item>
    <item>
      <title>Re: Recreate exact directory structure in another server</title>
      <link>https://community.hpe.com/t5/operating-system-linux/recreate-exact-directory-structure-in-another-server/m-p/4103951#M30766</link>
      <description>When I want to copy a directory from one server to another I use the command&lt;BR /&gt;&lt;BR /&gt;tar cf - &lt;DIRNAME&gt; | ssh &lt;SERVER&gt; 'cd &lt;SOMEDIR&gt;;tar xpvf -'&lt;BR /&gt;&lt;BR /&gt;I hope you find it useful!&lt;BR /&gt;&lt;BR /&gt;&lt;/SOMEDIR&gt;&lt;/SERVER&gt;&lt;/DIRNAME&gt;</description>
      <pubDate>Fri, 16 Nov 2007 12:32:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/recreate-exact-directory-structure-in-another-server/m-p/4103951#M30766</guid>
      <dc:creator>cdemmert</dc:creator>
      <dc:date>2007-11-16T12:32:14Z</dc:date>
    </item>
    <item>
      <title>Re: Recreate exact directory structure in another server</title>
      <link>https://community.hpe.com/t5/operating-system-linux/recreate-exact-directory-structure-in-another-server/m-p/4103952#M30767</link>
      <description>HI (again) :&lt;BR /&gt;&lt;BR /&gt;Court, thanks, and yes I was aware of the HP-UX port.  I'm a tool-builder for a variety of reasons, not the least of which --- TMTOWTDI.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...   &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 16 Nov 2007 12:32:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/recreate-exact-directory-structure-in-another-server/m-p/4103952#M30767</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-11-16T12:32:34Z</dc:date>
    </item>
    <item>
      <title>Re: Recreate exact directory structure in another server</title>
      <link>https://community.hpe.com/t5/operating-system-linux/recreate-exact-directory-structure-in-another-server/m-p/4103953#M30768</link>
      <description>Hi Stuart&lt;BR /&gt;Thanks for the tip..&lt;BR /&gt;I will use &lt;BR /&gt;# find . ! -type f ! -xtype f&lt;BR /&gt;&lt;BR /&gt;But now I have a strange problem regarding file modification time&lt;BR /&gt;&lt;BR /&gt;I used your suggested method to create the cpio file. &lt;BR /&gt;&lt;BR /&gt;# find /home  ! -type f ! -xtype f | cpio -ovH newc &amp;gt; file.cpio&lt;BR /&gt;&lt;BR /&gt;I transfer file.cpio to another server and do an extraction using&lt;BR /&gt;&lt;BR /&gt;# cpio -ivmH newc &amp;lt; file.cpio&lt;BR /&gt;&lt;BR /&gt;Did an "ls -l" command and found that all the directories created have a modification time of "now". Very strange..&lt;BR /&gt;&lt;BR /&gt;Run the same command again&lt;BR /&gt;&lt;BR /&gt;# cpio -ivmH newc &amp;lt; file.cpio&lt;BR /&gt;&lt;BR /&gt;Did an "ls -l" command and this time the file modification time is set to the correct original value!&lt;BR /&gt;&lt;BR /&gt;Is there a bug in cpio or did I use the command wrongly?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;</description>
      <pubDate>Sun, 18 Nov 2007 21:50:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/recreate-exact-directory-structure-in-another-server/m-p/4103953#M30768</guid>
      <dc:creator>kenny chia</dc:creator>
      <dc:date>2007-11-18T21:50:59Z</dc:date>
    </item>
  </channel>
</rss>

