The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 10-16-2008
cbo0485 cbo0485 is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 87
Quote:
Originally Posted by Klashxx View Post
Hi, use:
Code:
find /opt/apache/test*/logs \( -name "access_*.gz" -o -name "error_*.gz" \) -type f -mtime +31 -exec rm {} \;
find /opt/apache/test*/logs \( -name "access_*" -o -name "error_*" \) -type f -mtime +8 -exec gzip {} \;
Regards
The test* directory isn't actually all named test, it's the name of our webservers, and they don't have a normal pattern like that. Can I just substitute an * for test*? To make it

Code:
find /opt/apache/*/logs \( -name "access_*.gz" -o -name "error_*.gz" \) -type f -mtime +31 -exec rm {} \;
find /opt/apache/*/logs \( -name "access_*" -o -name "error_*" \) -type f -mtime +8 -exec gzip {} \;