- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: tar question
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
01-19-2003 07:53 AM
01-19-2003 07:53 AM
tar question
is this right for extract a specif directory from archive.tar
#dir to extract /data/pine and all subdir under /data/pine
tar xvf /dev/rmt/0m /data/pine
tar xvf /dev/rmt/0m /data/pine
Which is the correct one ?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2003 09:19 AM
01-19-2003 09:19 AM
Re: tar question
tar xv /data/pine
tar defaults to tape as a source for writing and reading.
Or
cd /data/pine
tar xv
But I don't have access to a UX box right now, so try the test command first.
cd /data/pine
tar tv
t is for test
or tar tvf /dev/rmt/0m /data/pine
See what's going to happen before you write something you might need to clean up.
Question. Is the original data source another machine? /data/pine directory perhaps?
Question. the two commands above seem to be duplicates, what difference am I missing?
Steve
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2003 09:56 AM
01-19-2003 09:56 AM
Re: tar question
This deppend of the way that was created in the source place.
If your default tape device is /dev/rmt/0m you can obviate "-f /dev/rmt/0m" option.
A tip for this is doing a tar tv, this ecreen output will show you the tar tape content.
Case 1: if your you see something as:
./root_dir/dir2/data/pine/etc...
this mean that tar have created in the source from "/" dir, so you need recover from "/". In this case, be careful with the rest of stored dirs, they could re-write some not wanted structure. tar xv ./root_dir/dir2/data/pine/
Case 2: if you see directly files that belong at the /data/pine dir structure, you must create first /data/pine tree, and then from there, execute "tar xv ." command.
In any case, to avoid risky situations, create a temporary dir with enough restoring space, then put inside and restore whole content by:
tar xv .
Important: protects the tape to avoid not wanted writing.
Rgds.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2003 10:04 AM
01-19-2003 10:04 AM
Re: tar question
If you decide recover the whole content of the tape in a temporary directory, i.e:
#cd temporal
#tar xv .
When the recovery process concludes, simply moves requested tree (/data/pine) to the appropriate place.
Rgds.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2003 10:33 AM
01-19-2003 10:33 AM
Re: tar question
tar xv /data/pine
tar xvf /dev/rmt/0m /data/pine
tar -xvf /dev/rmt/0m /data/pine
All the above will extract /data/pine from /dev/rmt/0m (tape drive) to /data/pine.
Regards
Tim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2003 11:42 AM
01-19-2003 11:42 AM
Re: tar question
The syntax you use to extract from a tar archive depends ENTIRELY on how the archive was created.
Here are 3 different exaples:
1) If the archive was created like this:
# tar -cvf /dev/rmt/0m /data/pine
Then you restore it like this:
# tar -xvf /dev/rmt/0m /data/pine
Note that your only option for restoring, unless you use 'pax' ('man pax' for more information), is to restore back to its original location, /data/pine.
2) If the archive was created like this:
# tar -cvf /dev/rmt/0m ./data/pine
Note the . in front of the directory name.
Then you restore it like this:
# tar -xvf /dev/rmt/0m ./data/pine
In this situation you can restore it to any sub-directory since it will restore using relative directory paths (remember the ./). This means it will created the data/pine directory structure in whatever directory you are currently in.
3) If the archive was created like this:
# tar -cvf /dev/rmt/0m data/pine
Then you restore it like this:
# tar -xvf /dev/rmt/0m data/pine
Again, since this is using relative paths, so when you restore the directory structure will be created in whatever directory you are currently in.
The best thing to do to figure out how to restore is to do a:
# tar -tvf /dev/rmt/0m
This will list the names of all the files on the tape. Kind of like a table of contents. See 'man tar' for more information.
When you see the output the 'tar -tvf' gives, you can then determine for certain which method above you can use to do the restore.
Good luck.