Link to home
Start Free TrialLog in
Avatar of ericdamphousse
ericdamphousse

asked on

Require assistance using tar to restore to a different directory

morning all,

I just updated from Solaris 9 to Solaris 10 (build 63). Previous to that, I did a backup of my users directories (well, only one, me) using tar. What I have done was 'tar cvf /dev/rmt/0 /home/ericd'.  On installing Solaris 10, I set up my user directories under /export/home, for example, /export/home/ericd. On Solaris 9, this was simply /home, i.e. /home/ericd.
The problem I currently have is that the restore will not work. The error message is as follows ===> tar: /home/ericd: Operation not applicable tar: cannot open /home/ericd/.java/blabla.

The closest thing I found was using the -C as such: tar xvf /dev/rmt/0 -C /export/home/ericd, but that aint working, it just sits there, looking dumb (or is that me sitting there, mmmm)

Any ideas?

Thanks
Eric
ASKER CERTIFIED SOLUTION
Avatar of ITcrow
ITcrow

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
cd to your destination directory, then use
  tar xf tarfile
then you should get a ./home
then do following:
  cd ..
 mv dir/home/ericd .
 
Avatar of ericdamphousse
ericdamphousse

ASKER

Thanks...

I am looking through the gnu tar to figure how I can achieve this.
I tried your example ahoffman, but I get the same error as I did previously. Seems the problem is simply that I have archived using an absolute path and now need to restore to a diff path. I know for a fact that I have used to Sun tar when I initially did this

eric
got it....

here is how it goes, using the GNU Tar:
/usr/local/bin/tar xvf /dev/rmt/0 -C /export

This will reconstruct my home/ericd under export, i.e. /export/home/ericd, just the way I wanted.

Thanks guys
You are welcome. I thought it will be worth-while not to spoon feed exact answer ;-)
That's fine by me :) thanks again