Solved

Restore files from tape using tar

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Access_log 17 121
Printing to old printer through Linux (CUPS) Print Server? 7 65
Setting up static IP - Ubuntu server 16.04 12 64
AWS ELB 5 78
rdate is a Linux command and the network time protocol for immediate date and time setup from another machine. The clocks are synchronized by entering rdate with the -s switch (command without switch just checks the time but does not set anything). …
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…
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.:
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…

777 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