Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

restore a directory from a tar backup into a seperate directory

Status
Not open for further replies.

tracee

Technical User
Nov 27, 2001
40
US
I used the tar command to restore files from one directory to another...but it would hang and nothing would show up in the new directory

tar -xvf/dev/rmt0 directory name /tmp/newdirectoryname

Thanks for your help
Tracee
 
Hi

I think you would have taken the tar by simply typing the "tar -cvf /dev/rmt0. So whenever you try to restore it will restore to the same path. So create a link with the same name in some other location, extract and unlink the link.

JSiva Om Maha Ganapathiye Namaga!
 
so, whenever I extract the files...it will go to the original path? OK, well I only want to restore one directory on a tape with many directories backed up...I dont want to restore all the directories....wouldnt the tar -cvf /dev/rmt0 grab all the files/directories and restore them? I am not understanding how it works.
Thanks!
 
Tar uses the path name (or file name you supply when creating the tar-file. So tar -cf <device> /mydir can only be restored into /mydir (or a link as mentioned). Path can be checked with tar -tvf <device>.
You could use tar-cvf <device> ./mydir to avoid the problem.
 
Hi

Yes you can restore only selected files or directories from your tar backup.

see man tar

JSiva Om Maha Ganapathiye Namaga!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top