LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-19-2010, 03:55 PM   #1
smithy2010
Member
 
Registered: May 2010
Location: UK
Distribution: OpenSuse 64 bit
Posts: 45

Rep: Reputation: 15
Smile restore tar.gz file to different location


Hi all,

I created a tar file in the following location:

/home/denis/scripts/

file name scriptsbkp.tar.gz

command used to create tar file:
tar -czvPf /home/denis/backups/scriptsbkp.tar.gz /home/denis/scripts

I want to extract tar.gz into following folder:
/home/denis/restored

but I receive following error:

tar: Error is not recoverable: exiting now

tar: Child returned status 2

tar: /home/denis/restored: Not found in archive

tar: Exiting with failure status due to previous errors



I used this command to restore:
tar -zxvf scriptsbkp.tar.gz /home/denis/restored

I can restore tar file in the /home/denis/scripts.

Can someone advise how do I restore tar.gz file to different location please? I was logged on as root while creating and restoring file.

Thanks in advance

Denis
 
Old 07-19-2010, 04:34 PM   #2
skola
Member
 
Registered: Nov 2009
Posts: 66

Rep: Reputation: 19
you don't need to be root to tar stuff in your home dirs. Only if you wanted the tarfile to go into another dir where the "home user" doesn't have permissions.

use:

tar -C /home/denis/restored -xzvf scriptsbkp.tar.gz

or put the -C /home/denis/restored at least 1 space away to right of your tarfile
 
Old 07-25-2010, 10:56 AM   #3
smithy2010
Member
 
Registered: May 2010
Location: UK
Distribution: OpenSuse 64 bit
Posts: 45

Original Poster
Rep: Reputation: 15
That worked well,

Thanks

Denis
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to restore a tar file and exclude a directory j-me Linux - General 3 01-26-2010 12:24 PM
BackUp & Restore with TAR (.tar / .tar.gz / .tar.bz2 / tar.Z) asgarcymed Linux - General 5 12-31-2006 02:53 AM
Restore a single file from tar archive lucktsm Linux - General 2 12-03-2006 01:57 PM
restore a tar file. David@330 Linux - Newbie 1 06-01-2006 09:26 AM
restore lfs from tar.bz2 file logicalfuzz Linux From Scratch 2 09-20-2005 01:13 AM


All times are GMT -5. The time now is 11:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration