LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   Understanding tar (https://www.linuxquestions.org/questions/debian-26/understanding-tar-880747/)

edhe1 05-14-2011 03:43 PM

Understanding tar
 
I want to restore, from backup, my openoffice documents, icedove folders, korganizer data, and iceweasel bookmarks; and it is a real chore finding where squeeze stores these things. The greater problem though, is that ark can't handle absolute path names, and my understanding of tar is limited.

I tried doing a general extract of my old /home directory, into my new squeeze distro, using tar -xzpPvf (file name), - and this I learned to be a mistake - because the file structure has been modified in squeeze. What was once /home/user/....odt is now /home/user/Documents/.....odt. Things stopped working in squeeze after I did the extract. I know now to only extract specific 'safe' items.
I have read the man page on tar, but still do not see how to get past the absolute path names difference?

As I understand it, tar looks for the same data path in my present system, and then replaces (or not) the data, depending on the tar options sent.

For example, with the bookmarks, is there a command that would extract the archive data into a 'safe place', and then I could later place it where it needed to be?

radiodee1 05-14-2011 04:02 PM

Quote:

Originally Posted by edhe1 (Post 4356452)
For example, with the bookmarks, is there a command that would extract the archive data into a 'safe place', and then I could later place it where it needed to be?

This should not be so hard to do. Move the tar.gz file to the 'safe' directory, and then cd to that directory. execute 'tar xvzf <filename>.tar.gz' to extract the info to the 'safe' location. tar will recreate the file structure that was originally archived at the new directory. Hope this helps.

gilead 05-14-2011 04:03 PM

On my system, by default tar extracts to the current directory. If I want to extract to somewhere else, I use -C. For example:
Code:

tar -xjvf /path/to/archive.tar.bz2 -C /location/to/extract/to
Was that what you were looking to do?


All times are GMT -5. The time now is 02:01 PM.