1832308 Members
2539 Online
110041 Solutions
New Discussion

TAR

 
SOLVED
Go to solution
Nobody's Hero
Valued Contributor

TAR

Hello All,
I am trying to tar a directory on tape, expolde it into a different directory. Any ideas?

Thx
UNIX IS GOOD
4 REPLIES 4
Phil Daws_2
Regular Advisor

Re: TAR

Tar it up using relative paths instead of absolute paths ie. usr/local instead of /usr/local
James R. Ferguson
Acclaimed Contributor

Re: TAR

Hi:

If the archive was made using absolute paths then you need to use 'pax' to restore the 'tar' archive to a different directory.

Regards!

...JRF...
Helen French
Honored Contributor

Re: TAR

hey,

U need to use relative paths. Try this:
1) go to the directory u want to backup ( cd dir_path)
2) tar -cvf device_name .
3) go to the directory uu want to restore ( cd new_dir_path)
4) tar -xvf device_name

HTH,
Shiju
Life is a promise, fulfill it!
Craig Rants
Honored Contributor
Solution

Re: TAR

Robert,

Say you want to tar up the /sbin dir. I usually would use:
cd /
tar cvf /dev/rmt/0m ./sbin

When you tar tvf to see what is there you see./sbin
./sbin/aaa

etc...

Just the way I do it to make sure that it will come out relative.

GL,
C
"In theory, there is no difference between theory and practice. But, in practice, there is. " Jan L.A. van de Snepscheut