Solved

Restore files from tape using tar

Posted on 2004-10-01
3
573 Views
Last Modified: 2013-12-16
Hi all,
  I am stuck with something that should realistically be straight forward.
I have a tape archive containing a file that has been backed up.  The file is on the tape if I do "tar tvf /dev/st0 > /tmp/tape_contents" and search the file /tmp/tape_contents I can see the file name.

The file I want to restore is shown in /tmp/tape_contents as "home/data1/Advertising Material/Marks Stuff/1] Documents/brochure 2004/BROCHURE"

How can I restore the file ?
I have tried the following:
tar -xf /dev/st0 "home/data1/Advertising Material/Marks Stuff/1] Documents/brochure 2004/BROCHURE"
And:
tar -xf /dev/st0 home/data1/Advertising Material/Marks Stuff/1] Documents/brochure 2004/BROCHURE

Neither restore the file.... my problems are down to the spaces in file names I believe (the files were created using a Samba share).
Time is running out now - I need to get this file back urgently.  Can anyone give me the correct command to restore the file shown above ?
0
Comment
Question by:ricurtis
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 40

Expert Comment

by:jlevie
ID: 12202749
It might be that "1]  " is simply the ASCII representation of some binary string in the directory name. What I'd do is to restore the "home/data1/Advertising Material/Marks Stuff" directory and pick the file out of that.
0
 

Author Comment

by:ricurtis
ID: 12202965
Just before I do this, is the correct command :
tar -xf /dev/st0 home/marketing/Advertising\ Material/Marks\ Stuff/* /tmp/restore/

to restore it into a different directory ?  I dont want to risk overwriting anything that has changed since this backup took place ?
0
 
LVL 40

Accepted Solution

by:
jlevie earned 250 total points
ID: 12203197
Nope, use:

mkdir /tmp/restore
cd /tmp/restore
tar xvf /dev/st0 home/marketing/Advertising\ Material/Marks\ Stuff

That will extract the specified directory into /tmp/restore.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
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…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

719 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