- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- tar *.html in subdirectory
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-15-2001 07:16 AM
05-15-2001 07:16 AM
I am trying to backup *.html from root directory of webserver, i tried using
find . -name "*.html" -exec tar cvf /tmp/web.tar {} \;
but it does not work. Can anybody help me on backing up only .html files to a file using tar.
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2001 07:20 AM
05-15-2001 07:20 AM
Re: tar *.html in subdirectory
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2001 07:42 AM
05-15-2001 07:42 AM
Re: tar *.html in subdirectory
find . -name *.html |xargs tar cvf /tmp/web.tar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2001 07:45 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2001 09:39 AM
05-15-2001 09:39 AM
Re: tar *.html in subdirectory
The explanation is as follows:
1. When you run
find . -name "*.html" -exec any_command {} \;
then any_command is performed sequentialy for all files found. So in the case
find . -name "*.html" -exec tar cvf /tmp/web.tar {} \;
tar is sequentialy run for any file found, and as a result in your tar archive there is only the last file found by the find command.
If you want to archive what you want can run for example (just a proposal):
tar cvf /tmp/wk.tar $(find . -name "*.html")
Rgds.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2001 01:04 PM
05-15-2001 01:04 PM
Re: tar *.html in subdirectory
>touch /tmp/backup.list
>find / -name "*.html" -print >> /tmp/backup.list
>tar cvf /tmp/backup.tar `cat /tmp/backup.list`
If you dont want to make a list first, instead of using the Korn shell syntax given above, the next command works on all systems.
>tar cvf /tmp/backup.tar `find / -name "*.html" -print`
Note that the quote before and after the find command is a grave mark, or back tick.
Regards,
Shannon