Operating System - HP-UX
1752810 Members
5492 Online
108789 Solutions
New Discussion юеВ

How to restore directory using tar -xvf

 
ITSD-ACCS
Frequent Advisor

How to restore directory using tar -xvf

I have a media with the following directory structure using tar -tvf

drwxr-xr-x 15 109 Aug 10 home/abc
drwxr-xr-x 15 109 Aug 10 home/edf

How can I restore the "home" directory ?

I have tried the following commands but nothing was restored.

cd /
tar -xvf /dev/rmt0 home/

2 REPLIES 2
Patrick Wallek
Honored Contributor

Re: How to restore directory using tar -xvf

Is the "home" directory the only thing on the tape?

If so, you can just do:

# tar -xvf /dev/rmt/0m

The above will restore everything on the tape.

If there are other directories on the tape you can try:

# tar -xvf /dev/rmt/0m home
Bill Hassell
Honored Contributor

Re: How to restore directory using tar -xvf

Leave off the trailing slash:

tar xvf /dev/rmt/0m home

tar is very particular about an exact match as far as the restore selection. This will restore home (and all subdirectories) to the current directory.


Bill Hassell, sysadmin