- 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
05-06-2004 06:16 PM
05-06-2004 06:16 PM
I want to do a restore of multiple files from a tarfile.
I cannot use wildcards *, so how can I restore all files in the tar file starting with say 040505?
Perhaps with some kind of script?
Thanks in advance, Alfons
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2004 06:23 PM
05-06-2004 06:23 PM
Re: tar restore
try this at the directory where you want to "untar":
# tar -xwf
the "w" option causes an interactive tar session in which you are asked to confirm restore for each file with either a "y" or "n". Slow but safe.
regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2004 06:39 PM
05-06-2004 06:39 PM
Re: tar restore
Because the archive contains thousands of little files and I need twenty of them your solution does not work for me.
Greetings, Alfons
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2004 06:40 PM
05-06-2004 06:40 PM
SolutionTry this,
tar tf /dev/rmt/0m | grep 040505 | xargs tar xvf /dev/rmt/0m
This will restore all files that has 040505 anywhere within the name of the file or the directory. You can try with grep "/040505" and it might help in extracting only files and directories starting with 040505.
Hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2004 06:49 PM
05-06-2004 06:49 PM
Re: tar restore
tar xvf /dev/whatever file1 file2 file3 ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2004 06:54 PM
05-06-2004 06:54 PM
Re: tar restore
it works fine, thanks.
Greetings, Alfons
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2004 06:54 PM
05-06-2004 06:54 PM
Re: tar restore
If you have all files inside a directory tree, you can restore it with:
tar xvf device directory_name
if not, you can list all files from the tape in a text file, then recover only what you want:
tar tf device > list_tar.txt
once you have list_tar.txt you can do:
cat list_tar.txt | grep 040505| xargs tar xvf device
The xargs is mandatory because it is possible to have a very long list of files and obtain a wrong number of arguments error.
Frank.