- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: "find" command
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-22-2002 02:13 PM
01-22-2002 02:13 PM
I'm having problems with using the "find" command. What I'm trying to do is find everything older than 520 days, and create a tar file with this data, however what I'm getting is a listing (like it would do when creating a tar file) but, the tar file is only the very last file that is listed. Here's my find statement:
find . -mtime +520 -exec tar xvf /home/rlkeller.tar {} \;
Any help would be greatly appreciated.
Chet
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2002 02:18 PM
01-22-2002 02:18 PM
Re: "find" command
use xargs too
find . -mtime +520 |xargs tar cvf tar.ball
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2002 02:21 PM
01-22-2002 02:21 PM
Re: "find" command
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2002 02:22 PM
01-22-2002 02:22 PM
Re: "find" command
1) find . -mtime +520 -exec ls {} \; > /tmp/tar.sh
2) edit /tmp/tar.sh and put
tar cvf /home/rlkeller.tar /file1 /file2
and so on, make sure you put a \ after each line in the file, you could use sed to do this. Then run /tmp/tar.sh
Also I noticed in you find command that you were using xvf instead of cvf, that may be causing you some problems.
GL,
C
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2002 02:26 PM
01-22-2002 02:26 PM
SolutionTry substituting 'xvf' with 'cvf'
and using xargs it processes the information far better. Using -exec uses one process for each input, xargs uses one for the lot, basically it is more efficient, but one drawback, it it does not find anything that it 'parsed' to it, it will backup everything!
# find . -mtime +520 -exec cvf /tmp/test {} \;
# find . -mtime +520 | xargs tar cvf /dev/test
HTH
-Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2002 02:32 PM
01-22-2002 02:32 PM
Re: "find" command
Try this:
# find . -mtime +520 | xargs tar xvf /home/rlkeller.tar
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2002 02:38 PM
01-22-2002 02:38 PM
Re: "find" command
This will work:
find . -mtime +520 | xargs tar cvf /home/rlkeller.tar
Darrell
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2002 02:40 PM
01-22-2002 02:40 PM
Re: "find" command
N/A mine, please.
Darrell
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2002 02:41 PM
01-22-2002 02:41 PM
Re: "find" command
find . -mtime +520 | xargs tar cvf /home/rlkeller.tar
Thanks again,
Chet