- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Restoring tape using tar
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
09-01-2004 09:29 AM
09-01-2004 09:29 AM
I took backup using tar
$tar -cvf /dev/rmt/0m /oracle
Now I have new directory /test. And I want to restore my backup into /test.
I have run tar xvf /dev/rmt/0m /test
or tar xvf /dev/rmt/0m .
But it is not working. It is not
doing anything , not restoring.
If I do "tar xvf /dev/rmt/0m /oracle , than it's start restoring backup but in to /oracle.
How can I restore backup into other directory ?
Thank you.
Henry
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2004 09:48 AM
09-01-2004 09:48 AM
SolutionWith tar, if you use the absolute path name to backup the file, then you can only restore it to the absolute path.
You will have to use pax to restore it to a relative path
# cd /test
# pax -rf /dev/rmt/0m -s '|^/|\./|'
the above command will restore the files from the tape relative to the /test directory
-- Sundar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2004 09:48 AM
09-01-2004 09:48 AM
Re: Restoring tape using tar
Try this:
cd /
tar -cvf /dev/rmt/0m ./oracle
cd /test
tar -xvf /dev/rmt/0m
This will put the data in /test/oracle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2004 12:55 PM
09-01-2004 12:55 PM
Re: Restoring tape using tar
u can use the both fbackup and frecover command in HP unix
to backup
# fbackup -f /dev/rmt/0m -i /oracle
to restore everything back to /oracle
# frecover -f /dev/rmt/0m -r
but if u still want to use tar
# tar -xvf /dev/rmt/0m ./oracle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2004 05:44 PM
09-01-2004 05:44 PM
Re: Restoring tape using tar
When if you try to extract then it will do it exactly /oracle/
You can change that
cd /;
tar -cvf /dev/rmt/0m oracle
or
tar -cvf /dev/rmt/0m ./oracle
To extract under /test then,
mkdir /test
cd /test
tar -xvf /dev/rmt/0m
It will now extract as /test/oracle/*
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2004 11:52 PM
09-01-2004 11:52 PM
Re: Restoring tape using tar
#tar -cvf /dev/rmt/0m ./oracle
#cd /test
#tar -xvf /dev/rmt/0m
regards
SK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2004 12:06 AM
09-02-2004 12:06 AM
Re: Restoring tape using tar
You can try as follows.
1. Use of pax
cd /where_to_resore
pax -rv -s '/^\///' < your.tar
2. Use GNU tar.
Take care of block size.
3. Use of chroot environment
/usr/bin/cp /usr/sbin/static/tar /tmp
/usr/bin/dd if=file.tar | /usr/bin/chroot /tmp ./tar xf -
Anil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2004 02:59 AM
09-02-2004 02:59 AM
Re: Restoring tape using tar
Because I can't backup again,
I have to restore tar tapes.
According to Sundar's reply,
I could restore tapes using pax command.
Thank you very much Sundar !!!
Henry