Operating System - HP-UX
1834018 Members
2180 Online
110063 Solutions
New Discussion

Re: recovery of a subset of files

 
SOLVED
Go to solution
Dan Copeland
Regular Advisor

recovery of a subset of files

Hi all,

I have set of three files on a big tar archive. I want to recover two files and leave the third. Is there an option in tar through which I will be able to accomplish this task? Please advise.
4 REPLIES 4
Santosh Nair_1
Honored Contributor
Solution

Re: recovery of a subset of files

If you give the full path for the files that you want to recover, then tar will recover only those files rather than everything from the archive. For example, if you have /tmp/file1, /tmp/file2 and /tmp/file3 in archive.tar, then

tar xvf archive.tar /tmp/file2 /tmp/file3

will recover just the two files, file2 and file3.

Hope this helps.

-Santosh
Life is what's happening while you're busy making other plans
Ian Dennison_1
Honored Contributor

Re: recovery of a subset of files

'tar -tf [Archive]' will get the list

'tar -xvf [Archive] [File Name]' will extract the specific file.

Try to use the full path name specified by the first 'tar' command when extracting the file using the second 'tar' command.

Do you want to recover this file to a different destination driectory or filename?

Share and Enjoy! Ian
Building a dumber user
Christopher McCray_1
Honored Contributor

Re: recovery of a subset of files

just use xv(f) options:

# tar xvf /dev/rmt/0m(or file)

Have a wonderful day!!

Chris
It wasn't me!!!!
Dan Copeland
Regular Advisor

Re: recovery of a subset of files

Hi Guys,

Santhosh, Ian and Chris. Thanks a lot for your quick reponse. I appreciate it.