- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to rename the restored file?
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
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
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
тАО07-15-2004 03:48 PM
тАО07-15-2004 03:48 PM
Let say I want to restore a file from tape and the path name is /tmp/test/123.txt
So, I go to the /u directory first and issue this command tar xvf /dev/rmt/0m /tmp/test/123.txt
Question:
1) Is there command to rename the file name during the restoration? How about others method like fbackup, cpio and ...?
regard
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-15-2004 04:31 PM
тАО07-15-2004 04:31 PM
Re: How to rename the restored file?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-15-2004 05:16 PM
тАО07-15-2004 05:16 PM
Re: How to rename the restored file?
For my case, the restored file will be located at /u/tmp/test/123.txt
I want to rename it to 456.txt instead of 123.txt during issue the tar command to restore. Is it able to do it?
regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-15-2004 06:03 PM
тАО07-15-2004 06:03 PM
Solution# tar xvf /dev/rmt/0m /tmp/test/123.txt | xargs mv /tmp/test/123.txt /u/456.txt
As a test I had a file of the same name and it did not get removed. It would be quite easy to test it yourself anyway. Just use a tarball archive file instead of a tape.
# tar cvf /tmp/crud /tmp/typescript
# tar xvf /tmp/crud | xargs mv /tmp/typescript /home/myfile
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-15-2004 07:23 PM
тАО07-15-2004 07:23 PM
Re: How to rename the restored file?
It has to be two stage process. For example:
tar xvf /dev/rmt/0m 123.txt;mv 123.txt 456.txt
sks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-19-2004 07:26 AM
тАО07-19-2004 07:26 AM
Re: How to rename the restored file?
It has the -s option to replace patterns in file names.
It has the -i option to prompt for new file names.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-19-2004 03:44 PM
тАО07-19-2004 03:44 PM
Re: How to rename the restored file?
Instead, change your command to:
cd /tmp
tar cvf /dev/rmt/0m test/123.txt
Now list the contents and you'll see:
test/123.txt
Now you can restore this directory and file in any directory. Just cd to the directory and restore the file. pax is much smarter than tar, and fbackup is much better than any of the classic Unix utilities, especially for this task.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-19-2004 07:47 PM
тАО07-19-2004 07:47 PM
Re: How to rename the restored file?
Currently the backup methods that I know is fbackup, tar, cpio and pax. May I know any difference between these methods? Just want to get all of your option whether which is the best method to backup? In term of user friendy, backup & restore efficiency & time and etc.
regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-19-2004 11:47 PM
тАО07-19-2004 11:47 PM
Re: How to rename the restored file?
I say: "must" because this is the only sane way to restore your system should the root disk go bad or be accidently erased. You will need a tape drive on your system, or you can use another HP-UX computer to act as a network respository for your backups. In either case, you'll need to spend some time reading the Ignite/UX docs for make_tape_recovery, and search the ITRC forums for suggested command line values to backup your VG00 disk(s).
While Ignite/UX will backup your files and create a bootable restore tape, recovering a few files from that tape is very convoluted. That's where a file backup tool such as tar, cpio and fbackup come in. Classic Unix tools cannot backup large files (such as a 15Gb file) so they are no longer as useful as they were several years ago. Also, these tools are very primitive. There is no table of contents, no error recovery and no formal method to handle multiple tapes.
fbackup is the best (free) backup tool in that it has many of the features found in commercial (not free) backup tools. It has a complete directory at the beginning of each tape, has an interface to handle multiple tapes and auto-changers, reads data from as many as 6 files simulataneously to keep the backup running full speed, and adds high speed search marks to the tape for very fast restores of a few files. Additionally, it has error recovery in case the tape has a bad spot.
If you are aware of the limitations and also aware of how your current system(s) will fare using tar, cpio, pax, etc, then these tools do work. However, for speed and reliability, fbackup/frecover are the tools of choice. Note that fbackup is HP-UX proprietary. Like most commercial backup programs, the format is not interchangeable with any other backup tool (especially on other non-HP-UX platforms).
Bill Hassell, sysadmin