- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Restore a entire directory using tar command
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
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
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
08-30-2011 11:30 AM
08-30-2011 11:30 AM
Hi All,
Can anyone help me to provide the syntax to restore a directory from tape archive? I am able to restore entire tape and didn't find a correct command to restore a directory. below is the option I already tried. The directory I am trying to restore from tape is alreay created with the same name.
cd /
tar xvphf /dev/rmt/1m <directory name to restore>
tar xvphf /dev/rmt /1m "directory name to restore"
Please help
Solved! Go to Solution.
- Tags:
- tar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2011 12:23 PM
08-30-2011 12:23 PM
Re: Restore a entire directory using tar command
> Can anyone help me [...]
It might be easier for us non-psychics to help if you showed us (a
relevant part of) a listing of what's on the tape, and revealed what,
exactly, you want to extract from the tape.
tar tfv [...]
> [...] <directory name to restore>
> [...] "directory name to restore"
Hiding potentially important details may not be the best way to get
accurate answers.
Also normally interesting:
uname -a
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2011 12:57 PM
08-30-2011 12:57 PM
Re: Restore a entire directory using tar command
Operating System.
HP-UX B.10.20
Here is what I get
tar -vxt /dev/rmt/1m
rwxrwx--- 0/101 53066 May 8 00:54 1999 ./symix27/symix/dc/menu-r.r
rwxrwx--- 0/101 81766 May 8 00:54 1999 ./symix27/symix/dc/mir.r
rwxrwx--- 0/101 52291 May 8 00:54 1999 ./symix27/symix/dc/mmenu-r.r
.....
.....
so...on
there is a directory in the system... by the name.
/dev/vg01/symix 3053521 9 2748159 0% /symix27
and I want to restore entire contents of /symix27 from tape archive to sytem directory name symix27.
please help to set the command to restore a directory using tar
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2011 12:58 PM
08-30-2011 12:58 PM
Re: Restore a entire directory using tar command
typo error
I used this command to get the list in archive tape
tar -tvf /dev/rmt/1m
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2011 01:10 PM - edited 08-30-2011 01:12 PM
08-30-2011 01:10 PM - edited 08-30-2011 01:12 PM
Re: Restore a entire directory using tar command
> [...]
> rwxrwx--- 0/101 53066 May 8 00:54 1999 ./symix27/symix/dc/menu-r.r#
> [...]
A name which you specify must match the name in the archive. If the
names in the archive are "./symix27/[...]", then you should probably
specify the thing to extract as "./symix27". You should be able to test
this:
tar -tvf /dev/rmt/1m ./symix27
If that shows you the right files, then, assuming that all those other
options are what you want, I'd try:
tar xvphf /dev/rmt /1m ./symix27
Because the names in the archive are relative ("./", which is
normally a good thing), you do need to do that "cd /", as you showed
before, if you want "./symix27" to go into "/symix27".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2011 01:47 AM
08-31-2011 01:47 AM
Re: Restore a entire directory using tar command
>You should be able to test this: tar -tvf /dev/rmt/1m ./symix27
HP's tar doesn't take a file with -t. But pax does: (Perhaps GNU tar too?)
pax -tvf /dev/rmt/1m ./symix27
- Tags:
- pax
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2011 07:15 AM
08-31-2011 07:15 AM
Re: Restore a entire directory using tar command
> HP's tar doesn't take a file with -t.
Hmmm. Trust no one, I always say. But, ooh. That's pretty lame.
Even the (pretty lame) VMSTAR on VMS does that. My brain is probably
tuned for Zip+UnZip these days, and, of course, "unzip -t" does it, too.
(It's not a good excuse, but it's the best I can do.)
> But pax does: (Perhaps GNU tar too?)
GNU "tar" does, too. (Of course.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2011 07:30 AM
08-31-2011 07:30 AM
Re: Restore a entire directory using tar command
@Steven Schweda wrote:> HP's tar doesn't take a file with -t.
Hmmm. Trust no one, I always say. But, ooh. That's pretty lame.
> But pax does: (Perhaps GNU tar too?)
GNU "tar" does, too. (Of course.)
HP should get with the program and look at the wealth of features GNU tools bring :-)
Personally, I have grown quite fond of 'pax'. In an HP-UX environment, in my opinion, it is a superior replacement to 'tar'.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2011 08:01 AM
08-31-2011 08:01 AM
Re: Restore a entire directory using tar command
For those keeping score, AIX /usr/bin/tar, Solaris /usr/sbin/tar, and
Tru64 /sbin/tar also do it. (Perhaps my brain is not quite so weak as I
had feared.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2011 08:09 AM
08-31-2011 08:09 AM
Re: Restore a entire directory using tar command
@Steven Schweda wrote:For those keeping score, AIX /usr/bin/tar, Solaris /usr/sbin/tar, and
Tru64 /sbin/tar also do it. (Perhaps my brain is not quite so weak as I
had feared.)
Yes, and score one more for Apple Max OS X.
Regards!
...JRF...