Summary

From: Amindra Mahto <MahtoA_at_dime.com>
Date: Mon Apr 22 2002 - 11:49:48 EDT
Thanks a lot to the following people who responded so quickly. I used the GNU
tar to solve my problem because I didn't want to spend 4-5 hours to backup
again by using relative path.

Lars Hecking <lhecking@nmrc.ie>

You have to use the P (capital P) option when _creating_ the archive.
 You could have found out yourself by reading the man page for tar.

"Brian Sherwood" <bsherwood@carescience.com>

use GNU tar to strip the leading "/" from the archive.

In the future, don't backup with a leading "/".


Another option is to symlink a directiry structure together and "trick" tar
into putting the file where you want it.

Brian

Jesus Garcia <jess@laeff.esa.es>
Problem is that you probably included the absolute path of the files
when doing that tar, and that's something difficult to solve in solaris;
it will try to restore from /. You should never include absolute paths
when doing a tar archive (remove leading /).

To restore in current directory you can use the GNU tar, which
automatically removes trailing /.

Grab it at: http://www.gnu.org/directory/tar.html

I hope this helps.

JESS

"Homan, Charles (NE)" <Charles.Homan@GDC4S.Com>
As they say in Maine, "You can't get there from here."  If you tar the files
using the absolute path (starting with "/") then they will untar using the
absolute path.  What you need to do is re-tar them using a relative path,
and then untar them.  For instance, you could change /tmp/listoffiles to be:

./export/home/kumar/installer
./usr/platform/sun4u/sbin/eeprom
./etc/hosts

Then make sure you are in the root directory ("cd /") before you run your
tar command.

Regards,
Charles


"Gurugunti, Mahesh" <MGurugunti@us.nomura.com>
I think if the files are backup using the absolute path, then no matter
which directory you are in they get extracted to original path mentioned
while backing up.
Meaning, if you think the files are backed up using /export/home/../../

then they get restored in /export/../../  , NOTE the absolute path (this
begins with  /export/ instead of  export/

Mahesh

Todd Urie <rtu@alumni.rowan.edu>
Since you created the files using absolute pathnames, the files will be
extracted using those same absolute pathnames.  This means that, using tar
alone, you will not be able to restore them to the /tmp directory.

However, if you use 'chroot' in conjunction with the restore, you may be
able to extract them to a temporary directory, then move them to where you
want.  You might want to view the man pages for 'tar' and 'chroot.'

HTH


Todd Urie


<Bertrand_Hutin@notes.amdahl.com>
as you put absolute paths in the archive, you can't restore elsewhere with
the Solaris tar.
you may try with the Gnu tar (get it on sunfreeware.com)


Gaziz Nugmanov <sunman@lists.gaziz.ca>
Hello Amindra,

When making a tar - get rid of "/" in the beginning of the files: ie
cd /
tar cvf /dev/rmt/0 export usr etc
...
then you can untar them this way:
cd /tmp
tar xvf /dev/rmt/0 export


Somesh Nagthan <snagthan@csc.com>
You will be unable to restore into the /tmp directory using tar xvf since
you did not use relative pathnames for the directories.
however you should be able to use chroot to change the root directory and
then restore as and where you please.
Please read the man page for chroot for more details.
Hope this helps.
Somesh.


==========================================================================
Here is my original question:

Hi All,

I tared three files in following way by using -I option

#tar cvf /dev/rmt/0 -I /tmp/listoffiles <return>
and the content of /tmp/listoffiles is as below
/export/home/kumar/installer
/usr/platform/sun4u/sbin/eeprom
/etc/hosts
I have already checked the tar status by # tar tvf /dev/rmt/0 and could see
all the above mentioned files so I'll say tar was done ok.

Question:

I want to restore the files in /tmp directory. I give the following command:
#cd /tmp
#tar xvf /dev/rmt/0 .<return>
But nothing gets restored then I tried
#tar xvf /dev/rmt/0 /export/home/kumar/installer . <return> then files got
restored in /export/home/kumar but not in /tmp
How to restore in current directory???? Please let me know. I'll summarise.

Thanks!

Amindra
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
Received on Mon Apr 22 11:55:16 2002

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:42:41 EST