- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: TAR RESTORE ISSUE
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-25-2009 09:19 PM
03-25-2009 09:19 PM
TAR RESTORE ISSUE
How can we restore a file from the tape, to different location.
For Eg:-
#tar -xvf /dev/rmt/0m /etc/hosts. While giving this command it will extract in the same location i.e, /etc/hosts (overwrite).
Note: I have already check by giving #tar -tvf -tvf /dev/rmt/0m.
I required this file to extract in different location. Can any one help me for this senario...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2009 10:16 PM
03-25-2009 10:16 PM
Re: TAR RESTORE ISSUE
Did you tried like this
go to a perticular directory suppose /tmp/dump
cd /tmp/dump
then give tar -xvf /dev/rmt/0mn .
Suraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2009 10:16 PM
03-25-2009 10:16 PM
Re: TAR RESTORE ISSUE
(like "etc/hosts") instead of an absolute
path (like "/etc/hosts") when creating the
archive.
If you're stuck with an archive which was
created with absolute paths, then you can
use "pax" or GNU "tar". A Forum search for
keywords like:
pax gnu tar absolute relative
should find several examples of each.
On a bad day, you could probably find a way
to use chroot, too, but that wouldn't be my
first choice.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2009 10:21 PM
03-25-2009 10:21 PM
Re: TAR RESTORE ISSUE
I have tried by cd /tmp, but its extract only on the same location.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2009 11:36 PM
03-25-2009 11:36 PM
Re: TAR RESTORE ISSUE
tar xvf /dev/rmt/0m etc/hosts
use a RELATIVE path not an absolute
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2009 11:52 PM
03-25-2009 11:52 PM
Re: TAR RESTORE ISSUE
> only on the same location.
Not amazing, if you have an archive with
absolute paths.
> tar xvf /dev/rmt/0m etc/hosts
>
> use a RELATIVE path not an absolute
This might be useful advice when the archive
is being created, but did you actually try
that "tar" command, or are you only guessing
that it will do something useful?
For some potentially less useless advice:
http://www.gnu.org/software/tar/manual/html_node/transform.html#SEC108
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2009 01:23 AM
03-26-2009 01:23 AM
Re: TAR RESTORE ISSUE
if you want to restore into /opt
# cd /opt
# pax -r -s '|/etc/*||' -f /dev/rmt/0m
When you use gnu tar it strips of the leading slash so which always becomes relative on extraction.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2009 01:24 AM
03-26-2009 01:24 AM
Re: TAR RESTORE ISSUE
#pax -r -s '|/etc/hosts||' -f /dev/rmt/0m
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2009 02:43 AM
03-26-2009 02:43 AM
Re: TAR RESTORE ISSUE
you can also use 'backup and recovery' in 'sam'.
First backup in sam.
Then, with an interactive recovery you can choose a different path.
HTH
Volkmar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2009 06:42 AM
03-26-2009 06:42 AM
Re: TAR RESTORE ISSUE
> leading slash so which always becomes
> relative on extraction.
It does? Can you demonstrate this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2009 07:03 AM
03-26-2009 07:03 AM
Re: TAR RESTORE ISSUE
Ooh. You're right. More manual reading
required.
dy # gtar cfv test.tar /root/sp.c
gtar: Removing leading `/' from member names
/root/sp.c
dy # gtar tfv test.tar
-rw-r--r-- root/sys 103 2008-10-22 11:08 root/sp.c
There's an option, if you really want it done
the dangerous way:
dy # gtar --absolute-names -c -v -f test2.tar /root/sp.c
/root/sp.c
dy # gtar tfv test2.tar
gtar: Removing leading `/' from member names
-rw-r--r-- root/sys 103 2008-10-22 11:08 /root/sp.c
And yes, without "--absolute-names", it
_will_ strip the leading slash when it
extracts/restores the archive.
Around here:
dy # uname -a
HP-UX dy B.11.11 U 9000/785 2012616114 unlimited-user license
dy # gtar --version
tar (GNU tar) 1.18
[...]
Well, that was educational.