<?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: TAR command options in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/tar-command-options/m-p/3148156#M900166</link>
    <description>HI,&lt;BR /&gt;to create an archive:&lt;BR /&gt;&lt;BR /&gt;tar cvf /ABSOLUTEPATH/FILENAME.tar &lt;BR /&gt;&lt;BR /&gt;AFAIK once the tar is created with absolute pathnames you have NO WAY to revert it to relative, so it is always advisable to use a relative one.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;There would be a workaround, but i do not think that you want to mess up with chroot ....&lt;BR /&gt;&lt;BR /&gt;  Massimo</description>
    <pubDate>Thu, 18 Dec 2003 08:34:49 GMT</pubDate>
    <dc:creator>Massimo Bianchi</dc:creator>
    <dc:date>2003-12-18T08:34:49Z</dc:date>
    <item>
      <title>TAR command options</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tar-command-options/m-p/3148153#M900163</link>
      <description>Hello colleagues,&lt;BR /&gt;a very simple question:&lt;BR /&gt;I need to know the options to create an archive by the TAR command and to keep the files absolute pathname; I need also to know if/how is possible to restore an archive containing files in absolute pathname on an a specific directory in relative format, i.e.&lt;BR /&gt;tar ... /tmp/pippo/..... -&amp;gt; /tmp/pippo/ fileas are archived&lt;BR /&gt;tar xvf .... on /usr/ directory -&amp;gt; /usr/tmp/pippo/ files are extracted&lt;BR /&gt;&lt;BR /&gt;thanks&lt;BR /&gt;Enrico</description>
      <pubDate>Thu, 18 Dec 2003 08:16:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tar-command-options/m-p/3148153#M900163</guid>
      <dc:creator>Enrico Venturi</dc:creator>
      <dc:date>2003-12-18T08:16:10Z</dc:date>
    </item>
    <item>
      <title>Re: TAR command options</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tar-command-options/m-p/3148154#M900164</link>
      <description>To do absolute paths just put absolute paths in the command&lt;BR /&gt; &lt;BR /&gt;"tar cvf /dev/rmt/0mn /usr /home etc"&lt;BR /&gt; &lt;BR /&gt;There is no way to restore these to relative directories if using standard HP-UX tar</description>
      <pubDate>Thu, 18 Dec 2003 08:20:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tar-command-options/m-p/3148154#M900164</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2003-12-18T08:20:34Z</dc:date>
    </item>
    <item>
      <title>Re: TAR command options</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tar-command-options/m-p/3148155#M900165</link>
      <description>Hi Enrico,&lt;BR /&gt;&lt;BR /&gt;To keep absolute pathname, then just create the tar with that path - Ex:&lt;BR /&gt;&lt;BR /&gt;tar cvf /path/to/file.tar /path/to/1stfile /path/to/2ndfile /path/to/3rdfile   etc.&lt;BR /&gt;&lt;BR /&gt;To extract this to a relative path you can't use the standard tar. Have to use a command like pax &amp;amp; I *think* GNU tar (gtar) can do this, but not positive.&lt;BR /&gt;&lt;BR /&gt;Rgds,&lt;BR /&gt;Jeff</description>
      <pubDate>Thu, 18 Dec 2003 08:21:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tar-command-options/m-p/3148155#M900165</guid>
      <dc:creator>Jeff Schussele</dc:creator>
      <dc:date>2003-12-18T08:21:02Z</dc:date>
    </item>
    <item>
      <title>Re: TAR command options</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tar-command-options/m-p/3148156#M900166</link>
      <description>HI,&lt;BR /&gt;to create an archive:&lt;BR /&gt;&lt;BR /&gt;tar cvf /ABSOLUTEPATH/FILENAME.tar &lt;BR /&gt;&lt;BR /&gt;AFAIK once the tar is created with absolute pathnames you have NO WAY to revert it to relative, so it is always advisable to use a relative one.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;There would be a workaround, but i do not think that you want to mess up with chroot ....&lt;BR /&gt;&lt;BR /&gt;  Massimo</description>
      <pubDate>Thu, 18 Dec 2003 08:34:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tar-command-options/m-p/3148156#M900166</guid>
      <dc:creator>Massimo Bianchi</dc:creator>
      <dc:date>2003-12-18T08:34:49Z</dc:date>
    </item>
    <item>
      <title>Re: TAR command options</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tar-command-options/m-p/3148157#M900167</link>
      <description>To restore in another directory, you can use the -C option of tar on HP-UX. But this will need an extra command in your case:&lt;BR /&gt;tar xvf &lt;TARFILE&gt; -C /usr/tmp&lt;BR /&gt;mv /usr/tmp/usr /usr/tmp/pippo&lt;BR /&gt;&lt;BR /&gt;(Haven't test this, but it should work.)&lt;BR /&gt;&lt;BR /&gt;Unless I misunderstand, and you want only the files in /usr from a tarfile containing more. In that case you need to list the files you want to retrieve at the end of the command line, but this can give problems too many arguments. pax is then the way to go, and can also sove your directory-name-change problem with a rewrite rule.&lt;/TARFILE&gt;</description>
      <pubDate>Thu, 18 Dec 2003 08:39:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tar-command-options/m-p/3148157#M900167</guid>
      <dc:creator>Elmar P. Kolkman</dc:creator>
      <dc:date>2003-12-18T08:39:04Z</dc:date>
    </item>
    <item>
      <title>Re: TAR command options</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tar-command-options/m-p/3148158#M900168</link>
      <description>As said, once you store files via tar with absolute paths, it is VERY difficult to restore them elsewhere.  I try to NEVER use absolute paths with tar.&lt;BR /&gt;&lt;BR /&gt;If you absolutely must restore something stored with absolute paths to a different directory, have a look at the 'pax' command.  It does have the ability to do what you want. ('man pax' for more info.)&lt;BR /&gt;&lt;BR /&gt;Something else you could do in your case is store the files as ./tmp/pippo (tar -cvf /dev/rmt/??? ./tmp/pippo)  This would still give you your /tmp dirnmae, but make restoring much easier.&lt;BR /&gt;&lt;BR /&gt;You could then do: cd /usr ; tar -xvf /dev/rmt/??? ./tmp/pippo&lt;BR /&gt;&lt;BR /&gt;Good Luck.</description>
      <pubDate>Thu, 18 Dec 2003 09:08:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tar-command-options/m-p/3148158#M900168</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2003-12-18T09:08:33Z</dc:date>
    </item>
    <item>
      <title>Re: TAR command options</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tar-command-options/m-p/3148159#M900169</link>
      <description>Hi,&lt;BR /&gt;tar cvf /path/files.tar /path/files_to_tar&lt;BR /&gt;&lt;BR /&gt;...to restore&lt;BR /&gt;take a look to this attach!&lt;BR /&gt;Hope this helps!</description>
      <pubDate>Thu, 18 Dec 2003 10:19:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tar-command-options/m-p/3148159#M900169</guid>
      <dc:creator>Lorenzo Facello</dc:creator>
      <dc:date>2003-12-18T10:19:14Z</dc:date>
    </item>
    <item>
      <title>Re: TAR command options</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tar-command-options/m-p/3148160#M900170</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;isnt pax able to rename a file path while extracting?&lt;BR /&gt;&lt;BR /&gt;greetings,&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;</description>
      <pubDate>Thu, 18 Dec 2003 15:57:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tar-command-options/m-p/3148160#M900170</guid>
      <dc:creator>Michael Schulte zur Sur</dc:creator>
      <dc:date>2003-12-18T15:57:08Z</dc:date>
    </item>
    <item>
      <title>Re: TAR command options</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tar-command-options/m-p/3148161#M900171</link>
      <description>Think about obtaining Gnu tar which doesn't suffer this limitation by dropping the leading / from the paths.&lt;BR /&gt;&lt;BR /&gt;As long as you use HP tar, the recommendation is to always use relative paths. For example:&lt;BR /&gt;&lt;BR /&gt;cd / &amp;amp;&amp;amp; tar c ./the/path/you/want&lt;BR /&gt;&lt;BR /&gt;Until you've recycled all of your tapes with absolute paths, the only option you have for recovery is setup the target path for chroot.&lt;BR /&gt;&lt;BR /&gt;In HP-UX 11.x, this should work:&lt;BR /&gt;&lt;BR /&gt;mkdir /target/path&lt;BR /&gt;cd /target/path&lt;BR /&gt;mkdir bin lib&lt;BR /&gt;cp /usr/bin/tar bin&lt;BR /&gt;cp /usr/lib/{dld,libdld,libc}.sl lib&lt;BR /&gt;&lt;BR /&gt;If tar were a static binary, this would have been more trivial.&lt;BR /&gt;&lt;BR /&gt;You do not need to copy any tar files to this location if you plan to use standard input.&lt;BR /&gt;&lt;BR /&gt;If you need access to a tape device, eg /dev/rmt/0m, then create the device file:&lt;BR /&gt;&lt;BR /&gt;mkdir -p dev/rmt&lt;BR /&gt;mknod dev/rmt/0m c major minor&lt;BR /&gt;&lt;BR /&gt;where the major and minor numbers are taken from ls -l /dev/rmt/0m. For example, on my system: mknod dev/rmt/0m c 205 0x041000&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Then extract the archive via stdin this way (The only required absolute path here is /usr/bin/tar because chroot does not look in PATH for to find commands.):&lt;BR /&gt;&lt;BR /&gt;su root -c "/usr/sbin/chroot /target/path /usr/bin/tar xf - &amp;lt; /path/to/tarfile"&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 18 Dec 2003 16:53:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tar-command-options/m-p/3148161#M900171</guid>
      <dc:creator>Jordan Bean</dc:creator>
      <dc:date>2003-12-18T16:53:29Z</dc:date>
    </item>
    <item>
      <title>Re: TAR command options</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tar-command-options/m-p/3148162#M900172</link>
      <description>Jordon,&lt;BR /&gt;&lt;BR /&gt;To your point on tar not being static.  You are partically correct, the tar program in /usr/bin is dynamically linked, however, there is a static version of the tar command in /sbin.  For that matter, all of the commands in /sbin are statically linked.&lt;BR /&gt;&lt;BR /&gt;JL</description>
      <pubDate>Fri, 19 Dec 2003 08:22:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tar-command-options/m-p/3148162#M900172</guid>
      <dc:creator>James Lynch</dc:creator>
      <dc:date>2003-12-19T08:22:03Z</dc:date>
    </item>
    <item>
      <title>Re: TAR command options</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tar-command-options/m-p/3148163#M900173</link>
      <description>Thanks, James! I knew pax was there, but never thought to look for tar. Well, it was a good exercise.</description>
      <pubDate>Fri, 19 Dec 2003 20:02:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tar-command-options/m-p/3148163#M900173</guid>
      <dc:creator>Jordan Bean</dc:creator>
      <dc:date>2003-12-19T20:02:10Z</dc:date>
    </item>
  </channel>
</rss>

