extracting file form tape


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers extracting file form tape
# 1  
Old 08-21-2002
extracting file form tape

Hello all,

I have done a search and follow the direction on how to extract a file form tar tape. With

1.) tar xf /dev/rmt/0 <filename>

2.) tar xf /dev/rmt/0 <fullpath/filename>

Both of these do not seem to work. Heres the scope I do daily backup of a 10g disk on to a DDS4 tape.
With the following command:

tar cvf /dev/rmt/0cnb /home/me

The machine is SunFire280 with solaris 5.8. I could just do a complete restore of the 10g but I do not have disk space for this. I just want to recover just 1 file from the 10g tar backup. Can anyone help?

Yes, I know that it would be better to do a ufsdump, but I don't want to put the machine into single user mode, which to my understanding is the best way to do a ufsdump, whit out data corruption.

THANKS
# 2  
Old 08-21-2002
Do a "tar tvf /dev/rmt/0" and look for the file that you want. Then do your your extract using the filename exactly the way it appeared on the listing. And if the filename is not on the listing you are out of luck.
# 3  
Old 08-21-2002
Check the tar file for the file you are looking for:
% tar tvf ./mytarredfiles.tar |grep myneeded.file
-rwxr-xr-x 1847/14 40 Jun 6 09:06 2001 ./test/myneeded.file

Then just grab the one file as it was listed:
%tar xf ../mytarredfiles.tar ./test/myneeded.file

This will create the directory (if any). If it shows up with /somedir/somefile, then it will extract back to there.
# 4  
Old 08-21-2002
It's been a while but can't wildcards be used with tar?

Ala,

tar -xvf /dev/my/tape/device ./*myfile*

EDIT:

Yeah, the wildcards work just fine. I would attempt to extract your file with prefix and postfix "*" although, you might pull a bunch of unwanted files. Depends on how unique the filename was.

Here is my testing the wildcards:

Code:
FreeBSD:auswipe:/home/auswipe/test $ ls -al
total 20
drwxr-xr-x   2 auswipe  auswipe   512 Aug 21 11:55 .
drwxr-xr-x  67 auswipe  auswipe  4608 Aug 18 02:00 ..
-rw-r--r--   1 auswipe  auswipe   458 Aug 15 10:20 clean.c
-rw-r--r--   1 auswipe  auswipe     1 Aug 15 09:48 file1
-rw-r--r--   1 auswipe  auswipe     1 Aug 15 09:48 file2
-rw-r--r--   1 auswipe  auswipe     1 Aug 15 09:48 file3
-rw-r--r--   1 auswipe  auswipe     1 Aug 15 09:48 file4
-rwxr-xr-x   1 auswipe  auswipe    64 Aug 15 10:35 test.sh
FreeBSD:auswipe:/home/auswipe/test $ tar -cvf mytar.tar *
clean.c
file1
file2
file3
file4
test.sh
FreeBSD:auswipe:/home/auswipe/test $ rm c*
FreeBSD:auswipe:/home/auswipe/test $ rm f*
FreeBSD:auswipe:/home/auswipe/test $ rm t*
FreeBSD:auswipe:/home/auswipe/test $ ls -al
total 18
drwxr-xr-x   2 auswipe  auswipe    512 Aug 21 11:55 .
drwxr-xr-x  67 auswipe  auswipe   4608 Aug 18 02:00 ..
-rw-r--r--   1 auswipe  auswipe  10240 Aug 21 11:55 mytar.tar
FreeBSD:auswipe:/home/auswipe/test $ tar -xvf mytar.tar *f*
file1
file2
file3
file4
FreeBSD:auswipe:/home/auswipe/test $ ls -al
total 26
drwxr-xr-x   2 auswipe  auswipe    512 Aug 21 11:56 .
drwxr-xr-x  67 auswipe  auswipe   4608 Aug 18 02:00 ..
-rw-r--r--   1 auswipe  auswipe      1 Aug 15 09:48 file1
-rw-r--r--   1 auswipe  auswipe      1 Aug 15 09:48 file2
-rw-r--r--   1 auswipe  auswipe      1 Aug 15 09:48 file3
-rw-r--r--   1 auswipe  auswipe      1 Aug 15 09:48 file4
-rw-r--r--   1 auswipe  auswipe  10240 Aug 21 11:55 mytar.tar


Last edited by auswipe; 08-21-2002 at 01:58 PM..
# 5  
Old 08-22-2002
Thanks

It was me. I did have the path the same as in the tar backup.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to cut a pipe delimited file and paste it with another file to form a comma separated outputfile

Hello ppl I have a requirement to split (cut in unix) a file (A.txt) which is a pipe delimited file into A1.txt and A2.txt Now I have to join (paste in unix) this A2.txt with external file A3.txt to form output file A4.txt which should be CSV (comma separated file) so that third party can... (25 Replies)
Discussion started by: etldev
25 Replies

2. Shell Programming and Scripting

Need to search a particular String form a file a write to another file using perl script

I have file which contains a huge amount of data. I need to search the pattern Message id. When that pattern is matched I need to get abcdeff0-1g6g-91g3-1z2z-2mm605m90000 to another file. Kindly provide your input. File is like below Jan 11 04:05:10 linux100 |NOTICE... (2 Replies)
Discussion started by: Raysf
2 Replies

3. Shell Programming and Scripting

Transpose Data form Different form

HI Guys, I have data in File A.txt RL03 RL03_A_1 RL03_B_1 RL03_C_1 RL03 -119.8 -119.5 -119.5 RL07 RL07_A_1 RL07_B_1 RL07_C_1 RL07 -119.3 -119.5 -119.5 RL15 RL15_A_1 RL15_C_1 RL15 -120.5 -119.4 RL16... (2 Replies)
Discussion started by: asavaliya
2 Replies

4. Shell Programming and Scripting

create txt file form data file and add some line on it

Hi Guys, I have file A.txt File A Data AK1521 AK2536 AK3164 I want create text file of all data above and write some data on each file. want Output on below folder /home/kka/out AK1521.txt Hi Welocme (3 Replies)
Discussion started by: asavaliya
3 Replies

5. UNIX for Dummies Questions & Answers

Extracting files from corrupted tape

I've got a backuptape in cpio format that was accidentally overwritten with a very small batch file. As I assume that the cpio header has been overwritten, I cannot extract files from the backup in the conventional manner: ( cpio -itv </dev/rct0 cpio: this is not a cpio file, bad header) ... (0 Replies)
Discussion started by: mart4179
0 Replies

6. UNIX for Advanced & Expert Users

How to parse through a file and based on condition form another output file

I have one file say CM.txt which contains values like below.Its just a flat file 1000,A,X 1001,B,Y 1002,B,Z ... .. total around 4 million lines of entries will be in that file. Now i need to write another file CM1.txt which should have 1000,1 1001,2 1002,3 .... ... .. Here i... (6 Replies)
Discussion started by: sivasu.india
6 Replies

7. UNIX for Dummies Questions & Answers

Mounting DLT tape and to backup file to tape

Hi there: I'm new here Can anyone help me: I have DS15 Alpha server : Unix 5.1B Now i need to connect a DLVT VS80 1U Rackmount Tape Drive unit. What is the exact comman to mount the DLTape IV?? How do i make backuo @ copy file to the tape? Thanx to all (0 Replies)
Discussion started by: ayzeayem
0 Replies

8. UNIX for Advanced & Expert Users

Space free on tape /delete a single file on tape

Hi, I' using a sun solaris server, I would like to known if there is the possibility to control how many space is free on a tape and how I can delete a single file on a tape. Thanks DOMENICO (3 Replies)
Discussion started by: Minguccio75
3 Replies

9. UNIX for Advanced & Expert Users

Changing Unix form to Microsoft Word form to be able to email it to someone.

Please someone I need information on how to change a Unix form/document into a microsoft word document in order to be emailed to another company. Please help ASAP. Thankyou :confused: (8 Replies)
Discussion started by: Cheraunm
8 Replies
Login or Register to Ask a Question