1834073 Members
2357 Online
110063 Solutions
New Discussion

tar restore path

 
SOLVED
Go to solution
Kim Kendall
Regular Advisor

tar restore path

I know I should know this...

I have a tar that has multiple paths on it and only want to restore a single path.

path1/
path1/files
path1/path1a
path1/path1a/files
path2/
path2/files
path2/path2a/
etc...etc.

I verified the tape (-tvf) and output to a text file, then grep'd the path I wanted and wrote to a second list.

I want to restore everything under /path2. Should I use the second list I wrote:

tar -xvf /dev/rmt/0m 'cat newlist'

or just restore using the path

tar -xvf /dev/rmt/0m path2/*
4 REPLIES 4
Jeff_Traigle
Honored Contributor
Solution

Re: tar restore path

If you want everything under path2, just do the follwoing:

tar xvf /dev/rmt/0m path2
--
Jeff Traigle
Steve Steel
Honored Contributor

Re: tar restore path

Hi

Option 1 is best

Option 2 will only restore files it finds in
path2

Using path2 only should also work

Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
Kim Kendall
Regular Advisor

Re: tar restore path

use path2 without the trailing "/"?
Jeff_Traigle
Honored Contributor

Re: tar restore path

I don't know that the trailing / matters. I never use one.
--
Jeff Traigle