- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- re-directing tar extract to another directory
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
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
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
тАО03-24-2009 04:20 AM
тАО03-24-2009 04:20 AM
# tar cvf /dev/rmt/0m /apps/xx
Now I am trying to restore the archive to a different directory so I get for example
/apps/ora/xx
What command should I use? Thnxs.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-24-2009 04:26 AM
тАО03-24-2009 04:26 AM
Re: re-directing tar extract to another directory
It is easier if you create a tar file without the leading slash /.
# cd path
# tar cvf /dev/rmt/0m apps/xx
Regards,
Robert-Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-24-2009 04:32 AM
тАО03-24-2009 04:32 AM
SolutionAs Robert-Jan has already noted, don't use absolute paths in making your archive. If you have, or are presented this case, you can use 'pax' to rename the directory during recovery:
# cd /newapps
# pax -r -s '|/apps/*||' -f /dev/rmt/0m
...will recover the files as /newapps/xx
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-24-2009 04:40 AM
тАО03-24-2009 04:40 AM
Re: re-directing tar extract to another directory
GNU tar pax
should find many previous similar threads.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-24-2009 05:46 AM
тАО03-24-2009 05:46 AM
Re: re-directing tar extract to another directory
Will test this later but could you explain the role of the double pipe in the -s replacement string.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-24-2009 05:51 AM
тАО03-24-2009 05:51 AM
Re: re-directing tar extract to another directory
> Will test this later but could you explain the role of the double pipe in the -s replacement string.
The pipe symbol was simply my choice for a delimiter in the substitution expression. The "double pipe" reduces to "substitute nothing" meaning for "/apps/*" substitute an empty string.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-24-2009 06:36 AM
тАО03-24-2009 06:36 AM
Re: re-directing tar extract to another directory
Whenever you want to restore into alternate location do not use absolute path. Instead you should go to that dir and take backup.
#cd /apps/xx
#tar cvf /dev/rmt/0m .
When you restore it will not create the path /apps/xx . You can restore it anywhere.
Ganesh.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-24-2009 07:18 AM
тАО03-24-2009 07:18 AM
Re: re-directing tar extract to another directory
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-24-2009 07:19 AM
тАО03-24-2009 07:19 AM