Solved

Restore files from tape using tar

Posted on 2004-10-01
3
572 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

733 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