?
Solved

Require assistance using tar to restore to a different directory

Posted on 2004-10-29
6
Medium Priority
?
530 Views
Last Modified: 2013-12-27
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
0
Comment
Question by:ericdamphousse
  • 3
  • 2
6 Comments
 
LVL 5

Accepted Solution

by:
ITcrow earned 500 total points
ID: 12443335
Pay a visit to:
http://www.gnu.org/software/tar/tar.html

Manual:
http://www.gnu.org/software/tar/manual/html_mono/tar.html

Search in page for absolute / relative.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 12443426
cd to your destination directory, then use
  tar xf tarfile
then you should get a ./home
then do following:
  cd ..
 mv dir/home/ericd .
 
0
 

Author Comment

by:ericdamphousse
ID: 12443730
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
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:ericdamphousse
ID: 12443858
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
0
 
LVL 5

Expert Comment

by:ITcrow
ID: 12443870
You are welcome. I thought it will be worth-while not to spoon feed exact answer ;-)
0
 

Author Comment

by:ericdamphousse
ID: 12444029
That's fine by me :) thanks again
0

Featured Post

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses

601 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question