<?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: How to use TAR to restore files in a different place. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-use-tar-to-restore-files-in-a-different-place/m-p/3405140#M201593</link>
    <description>Depends how you created the archive - absolute or relative paths...&lt;BR /&gt;&lt;BR /&gt;cd /&lt;BR /&gt;tar cvf /tmp/sometarfile.tar home&lt;BR /&gt;&lt;BR /&gt;then cd /tmp&lt;BR /&gt;tar xvf sometarfile.tar &lt;BR /&gt;&lt;BR /&gt;that will dump archive of home all to tmp...&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Thu, 21 Oct 2004 10:10:34 GMT</pubDate>
    <dc:creator>Geoff Wild</dc:creator>
    <dc:date>2004-10-21T10:10:34Z</dc:date>
    <item>
      <title>How to use TAR to restore files in a different place.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-use-tar-to-restore-files-in-a-different-place/m-p/3405138#M201591</link>
      <description>On hp-ux 11i, I want to use TAR to restore some data, but I do not want to restore to the original place. I remember that TAR restores data only to the original place. How to use TAR to restore files in a different place ?&lt;BR /&gt;Thanks.</description>
      <pubDate>Thu, 21 Oct 2004 10:04:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-use-tar-to-restore-files-in-a-different-place/m-p/3405138#M201591</guid>
      <dc:creator>Simon Qu</dc:creator>
      <dc:date>2004-10-21T10:04:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to use TAR to restore files in a different place.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-use-tar-to-restore-files-in-a-different-place/m-p/3405139#M201592</link>
      <description>It depends how the tar was created.  It's good practice to create tars with relative paths, eg&lt;BR /&gt;&lt;BR /&gt;cd /etc ; tar cvf fred.tar .&lt;BR /&gt;&lt;BR /&gt;rather than&lt;BR /&gt;&lt;BR /&gt;tar cvf fred.tar /etc&lt;BR /&gt;&lt;BR /&gt;In the latter case, files will be stored as /etc/hosts, /etc/passwd etc, whereas in the former they will be ./passwd, ./hosts etc, meaning they can be restored anyway.&lt;BR /&gt;&lt;BR /&gt;tar tvf fred.tar will show you whether the tar is relative or absolute.  If filenames are prefixed with ./ then it's relative and you're fine.&lt;BR /&gt;&lt;BR /&gt;If it's an absolute tar, you only have 2 options - tar through symbolic links, or create a chroot jail.&lt;BR /&gt;&lt;BR /&gt;In the first case, it depends what you are restoring, and whether you can rename things out of the way.  If you can create a symbolic link where the directory would be to where you want it to, you're set.  If not then: -&lt;BR /&gt;&lt;BR /&gt;The other option is a chroot jail.  Basically you need to create a small environment somewhere, eg under /var/tmp/jail, under which you'll need the tar binary, libc libraries, a shell etc.  Then chroot to this, and you can then untar under this.&lt;BR /&gt;&lt;BR /&gt;It's messy, its complicated, but it makes you quickly realise the benefit of relative pathed tars ;)</description>
      <pubDate>Thu, 21 Oct 2004 10:09:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-use-tar-to-restore-files-in-a-different-place/m-p/3405139#M201592</guid>
      <dc:creator>Simon Hargrave</dc:creator>
      <dc:date>2004-10-21T10:09:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to use TAR to restore files in a different place.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-use-tar-to-restore-files-in-a-different-place/m-p/3405140#M201593</link>
      <description>Depends how you created the archive - absolute or relative paths...&lt;BR /&gt;&lt;BR /&gt;cd /&lt;BR /&gt;tar cvf /tmp/sometarfile.tar home&lt;BR /&gt;&lt;BR /&gt;then cd /tmp&lt;BR /&gt;tar xvf sometarfile.tar &lt;BR /&gt;&lt;BR /&gt;that will dump archive of home all to tmp...&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 21 Oct 2004 10:10:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-use-tar-to-restore-files-in-a-different-place/m-p/3405140#M201593</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2004-10-21T10:10:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to use TAR to restore files in a different place.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-use-tar-to-restore-files-in-a-different-place/m-p/3405141#M201594</link>
      <description>If you saved with relative names, then just cd to where you want to restore.&lt;BR /&gt; &lt;BR /&gt;If you used absolute path names (begins with "/"), then either use gnu tar or use the "pax" command.&lt;BR /&gt; &lt;BR /&gt;HTH&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Thu, 21 Oct 2004 10:11:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-use-tar-to-restore-files-in-a-different-place/m-p/3405141#M201594</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2004-10-21T10:11:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to use TAR to restore files in a different place.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-use-tar-to-restore-files-in-a-different-place/m-p/3405142#M201595</link>
      <description>Hi Simon,&lt;BR /&gt;&lt;BR /&gt;you can use pax to do that,&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www2.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&amp;amp;docId=200000062772639" target="_blank"&gt;http://www2.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&amp;amp;docId=200000062772639&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The itrc doc id is UBACKKBRC00008718&lt;BR /&gt;&lt;BR /&gt;Hope this helps.&lt;BR /&gt;&lt;BR /&gt;Regds&lt;BR /&gt;</description>
      <pubDate>Thu, 21 Oct 2004 10:12:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-use-tar-to-restore-files-in-a-different-place/m-p/3405142#M201595</guid>
      <dc:creator>Sanjay_6</dc:creator>
      <dc:date>2004-10-21T10:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to use TAR to restore files in a different place.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-use-tar-to-restore-files-in-a-different-place/m-p/3405143#M201596</link>
      <description>the tar -C command should redirect output to another location.&lt;BR /&gt;&lt;BR /&gt;-C directory name causes tar to chdir and unarchive relative to that location.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Thu, 21 Oct 2004 10:12:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-use-tar-to-restore-files-in-a-different-place/m-p/3405143#M201596</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2004-10-21T10:12:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to use TAR to restore files in a different place.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-use-tar-to-restore-files-in-a-different-place/m-p/3405144#M201597</link>
      <description>If you used absolute path names in tar backups, you can restore to original path.&lt;BR /&gt;&lt;BR /&gt;BUT, you have following options.&lt;BR /&gt;&lt;BR /&gt;1. Use GNU tar. Get it from &lt;A href="http://hpux.connect.org.uk." target="_blank"&gt;http://hpux.connect.org.uk.&lt;/A&gt; You need to know block size&lt;BR /&gt;of hp's tar.&lt;BR /&gt;&lt;BR /&gt;2. Use pax as follows.&lt;BR /&gt;pax -rv -s '/^\///' &amp;lt; tar_file&lt;BR /&gt;&lt;BR /&gt;3. Use of chroot. This did not work for me. Try it.&lt;BR /&gt;&lt;BR /&gt;/usr/bin/cp /usr/sbin/static/tar /tmp&lt;BR /&gt;/usr/bin/dd if=file.tar | /usr/bin/chroot /tmp ./tar xf -  &lt;BR /&gt;</description>
      <pubDate>Thu, 21 Oct 2004 10:14:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-use-tar-to-restore-files-in-a-different-place/m-p/3405144#M201597</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2004-10-21T10:14:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to use TAR to restore files in a different place.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-use-tar-to-restore-files-in-a-different-place/m-p/3405145#M201598</link>
      <description>Actually I'll be a little clearer on the chroot jail, it's not as bad as it sounds really: -&lt;BR /&gt;&lt;BR /&gt;Lets say you have a tar which contains a set of database files, eg /u01/oradata/db/system.dbf etc etc&lt;BR /&gt;&lt;BR /&gt;To restore this to /u01/oradata, you would do: -&lt;BR /&gt;&lt;BR /&gt;mkdir /u02/jail&lt;BR /&gt;cd /u02/jail&lt;BR /&gt;cp /sbin/tar /sbin/ls /sbin/sh . (you don't need libraries as these are statically linked)&lt;BR /&gt;cp /your/tar/file . (if you want to restore from tape, copy the device eg cp -r /dev/rmt/0mn .)&lt;BR /&gt;chroot /u02/jail sh (you are now in the jail)&lt;BR /&gt;./ls -l (./ needed as no path defined)&lt;BR /&gt;./tar cvf tarfile_or_devicename&lt;BR /&gt;&lt;BR /&gt;This will then untar under the chroot, which will put the files under /u02/jail/u01/oradata etc.  You can then exit the shell and move the files as required.&lt;BR /&gt;</description>
      <pubDate>Thu, 21 Oct 2004 10:17:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-use-tar-to-restore-files-in-a-different-place/m-p/3405145#M201598</guid>
      <dc:creator>Simon Hargrave</dc:creator>
      <dc:date>2004-10-21T10:17:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to use TAR to restore files in a different place.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-use-tar-to-restore-files-in-a-different-place/m-p/3405146#M201599</link>
      <description>Steven,&lt;BR /&gt;&lt;BR /&gt;I think the "-C" option is for only backing up, not restoring.&lt;BR /&gt; &lt;BR /&gt;HTH&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Thu, 21 Oct 2004 10:24:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-use-tar-to-restore-files-in-a-different-place/m-p/3405146#M201599</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2004-10-21T10:24:47Z</dc:date>
    </item>
  </channel>
</rss>

