I need to copy a tar backup to a fs. The scenario is that inside the tar backup has multiple directory but need to extract to a single directory. can it be done?
Hi,
you can. First you have to now the the tree your tar file.
For example you need all files under /a/b/c
$ tar -xvf /dev/rmt<number> /a/b/c
Regards Boris
I dun quite get you... I want all the file inside the tape to be extracted to the directory. I've tried cd to the directory that i wanted and executed the tar command. It ended up restoring to /. Thos direcroty in the tape are copy of fs I made before the the server crashes using tar command. These fs are important coz it contains fixes and patches for AIX from version 4.1.5. to 5.1. I really need these files.
Hi
If your tar backup is an absolute path backup and you want to restore the files from the backup in another dir then you will have to use the command pax.
Lets say that you have backed up /home using absolute path backup
# tar -cvf /dev/rmt0 /home
and you want to restore this in the dir /work then
using pax
# pax -rf /dev/rmt0 -s/home/work/p
-s/home/work/p does the dir change. It functions simillar to the vi search and change.
Check out the pax man page for more details
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.