HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- how to find and tar?
Operating System - HP-UX
1834089
Members
2189
Online
110063
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
08-17-2004 06:34 AM
08-17-2004 06:34 AM
Hi :
I am trying to find all the files in a directory which are 30 days old and tar .
I am doing
find $DIRNMAE -name "test.log.*" -type f -a -mtime +30 -exec tar -cvpf file.tar "{}" \;
the problem is its creating the tar for each file and so when I untar it just has the last file in it..
Is there any other way? Can I crate a 0 byte tar and use tar -uvpf? I am just not sure how to go for that.
Any suggestions?
I am trying to find all the files in a directory which are 30 days old and tar .
I am doing
find $DIRNMAE -name "test.log.*" -type f -a -mtime +30 -exec tar -cvpf file.tar "{}" \;
the problem is its creating the tar for each file and so when I untar it just has the last file in it..
Is there any other way? Can I crate a 0 byte tar and use tar -uvpf? I am just not sure how to go for that.
Any suggestions?
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2004 06:44 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2004 07:15 AM
08-17-2004 07:15 AM
Re: how to find and tar?
works thanks!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2004 11:09 AM
08-17-2004 11:09 AM
Re: how to find and tar?
As 'tar' doesn't take a file-list from stdin (like 'cpio' or other such tools), you either have to append to the tar file created (as Sundar has given an example), or provide the file-list as arguments, i.e.
# tar -cvf file.tar $(find . -type f -name "test.log.*" -mtime +30 -print)
If you expect a lot of them however, Sundar's example is much better, as this method can generate a long-list of filenames exceeding the argument list limit.
# tar -cvf file.tar $(find . -type f -name "test.log.*" -mtime +30 -print)
If you expect a lot of them however, Sundar's example is much better, as this method can generate a long-list of filenames exceeding the argument list limit.
One long-haired git at your service...
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP