- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: How to un-TAR to a particular dir.
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-30-2002 07:49 PM
тАО06-30-2002 07:49 PM
I have created a tar in a tape of the following two dirs
/u01/prod/data
/u02/prod/data
Now when I am going to un-TAR it to another server, Do I need to have /u01/prod/data and /u20 dir or the un-TAR will create?
And can I un-TAR it to /u01/prod/prodata
and /u02/prod/proddata ?
Another question is from the TAR, can I get a particular file?
Thanks in Adv
Regards
Shah
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-30-2002 08:00 PM
тАО06-30-2002 08:00 PM
SolutionYou will not be able to untar your files to another directory as it looks as though you created your archive using the absolute pathnames. This means the files will be restored to their original locations. If you are restoring to the same paths then you shouldn't have a problem
To get a particular file
tar xvf
HTH
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-30-2002 08:01 PM
тАО06-30-2002 08:01 PM
Re: How to un-TAR to a particular dir.
If the directory doesn't exist, it will get created from the tar extraction, tar xvf .....
Yes you can extract one file at a time if you wish.
e.g.
# tar xvf /dev/rmt/0m /u02/prod/prodata/mydatafile
One piece of advice, when you create a tar archive from / always use ./u02 to do your backups not /u02
From this you can extract into any other named filesystem or directory.
e.g.
# cd /
# tar cvf ./u02 ./u03
Have a look at the man page which also has some other suggestions.
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-30-2002 08:04 PM
тАО06-30-2002 08:04 PM
Re: How to un-TAR to a particular dir.
To create your tar files with relative path names , first cd the directory then create you tar file
cd
tar cvf /dev/rmt/0m
That way when you wish to restore your archive you can go to whatever directory you wish and untar your file
HTH
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-30-2002 08:37 PM
тАО06-30-2002 08:37 PM
Re: How to un-TAR to a particular dir.
Regards
Shah
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-01-2002 12:02 AM
тАО07-01-2002 12:02 AM
Re: How to un-TAR to a particular dir.
Hi,
Actually there is a way to restore to
a different directory even if the tape was
made using absolute path:
1- Logon as root
2- cd to directory : cd /newdir
3- cp tar over : cp /sbin/tar /newdir
4- make sure about tar owner and group : chown bin:bin tar
5- make the tapedevicefile example : mknod 0m c 212 0x010000
(or just cp /dev/rmt/0m /newdir)
6- chroot /newdir tar xvf 0m
will copy all files and the directory structure to /newdir
Regards
Olav