- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- TAR Restore
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
06-07-2001 07:37 AM
06-07-2001 07:37 AM
again... When I try to restore files from a tape using tar command, I write:
tar xvf /dev/rmt/3m /local/name_of_file
than the file is restored in original location, but I need to put it in another local. How can I do?
Thanx.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2001 07:54 AM
06-07-2001 07:54 AM
Re: TAR Restore
The tar extracts files back in the Path they were written as , ie in cae you used to back them up using tar cvf /dev/rmt /etc/passwd then it can restored only in /etc/passwd . There is one other way in case you can take the back up again take it as go to that directory and issue tar cvf /dev/rmt
Ofcourse you have the option to the move the files in case there is no other way.
Manoj Srivastava
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2001 07:56 AM
06-07-2001 07:56 AM
Re: TAR Restore
There may be not much to do other than move the file yourself, because it seems you saved with absolute path...
The only solution I see is if the file already exists, is to move it somewhere else, then restore from the tape the one from TAR...
Good luck
Victor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2001 08:22 AM
06-07-2001 08:22 AM
Re: TAR Restore
pax -r -f mysave.tar -s:^/usr/etc:/newpath:
It will still be an absolute path, but you can restore it to a different location!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2001 08:28 AM
06-07-2001 08:28 AM
SolutionThere is a way using pax which can read a tar archive. As had been mentioned, you should make your backups using relative paths to make life simpler.
For my example, I assume that I originally did a tar backup of /home which contains many directories.
e.g. tar cvf /dev/rmt/3m /home
Now lets say that I want just /home/cstephen (and all of his files) but not /home/user1, /home/user2, ...
AND
I want to restore cstephen's files to
/tmp/acs
This is very much like your situation. Here's the command:
pax -r -f /dev/rmt/3m -s ',/home/cstephen,/tmp/acs,' /home/cstephen
The effect of this command is to do an extract from device /dev/rmt/3m (which CAN be a previous tar or a cpio) and match the /home/cstephen files. The -s argument tells it to substitute /tmp/acs anytime it matches /home/cstephen. The commas are used as delimiters rather than the typical slash but you can choose other delimiters id comma's are embedded in your filenames.
Man pax for details.
This should do the trick, Clay