- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Using tar and pax commands
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
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
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-29-2009 11:41 AM
03-29-2009 11:41 AM
A colleague used tar to backup a /apps/oracle/products/10g to tape using tar with absolute path. How can I restore this to a differnt directory eg /tmp/restore. Was told I could use pax but the syntax is confusing.
Any help?
Regards
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2009 11:55 AM
03-29-2009 11:55 AM
Solution# cd /tmp/restore
# pax -r -s '|/apps/oracle*||' -f /dev/rmt/0m
http://forums13.itrc.hp.com/service/forums/questionanswer.do?threadId=1326158
Regards,
Robert-Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2009 12:03 PM
03-29-2009 12:03 PM
Re: Using tar and pax commands
/apps/oracle/products/10g
I should use
pax -r -s '|/apps/oracle/products/10g*||' -f /dev/rmt/0m
??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2009 09:03 PM
03-29-2009 09:03 PM
Re: Using tar and pax commands
/apps/oracle/products/10g, I should use
pax -r -s '|/apps/oracle/products/10g*||' -f /dev/rmt/0m
You should replace that "*" by a "/" then this will restore the subdirectory tree into the current directory.
(I think Robert-Jan's and JRF's use of "*" is not valid for a RE, only for a File Matching Pattern.)
If you want /tmp/restore, you can use:
-s '|/apps/oracle/products/10g/|/tmp/restore/|'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2009 09:18 PM
03-29-2009 09:18 PM
Re: Using tar and pax commands
For easy restore to anywhere do this steps
If I want to take backup or /etc then first
cd /etc
tar cvf /dev/rmt/0m .
it will take /etc into tape
Now when you want to restore /etc
Just go to the directory suppose /tmp
cd /tmp
mkdir etc
cd etc
pwd
/tmp/etc
tar xvf /dev/rmt/0m .
You can restore it anywhere.
Suraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2009 06:59 AM
03-30-2009 06:59 AM
Re: Using tar and pax commands
> Dennis: (I think Robert-Jan's and JRF's use of "*" is not valid for a RE, only for a File Matching Pattern.)
Yes, I agree. The manpages for 'pax' note that the substitution is performed using the Basic Regular Expression syntax used by 'ed'
Hence as Dennis noted:
# ... -s '|/apps/oracle*||'
...should be:
# ... -s '|/apps/oracle/products/10g/|/tmp/restore/|'
Regards!
...JRF...