The UNIX and Linux Forums  

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



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Remove logs by date cvdev SUN Solaris 3 05-31-2008 03:09 AM
Remove the date from the file pradkumar UNIX for Dummies Questions & Answers 5 01-10-2008 01:36 AM
how to remove files with a date justintime Shell Programming and Scripting 5 09-10-2006 10:50 PM
How do I take out(remove) the date part in the file name? ruthless HP-UX 5 02-06-2006 01:32 PM
Remove files based on date hshapiro UNIX for Dummies Questions & Answers 4 12-09-2005 12:21 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 10-09-2007
eric_wong_ch eric_wong_ch is offline
Registered User
  
 

Join Date: Sep 2007
Posts: 10
Remove out date logs

hi all,

i would like to write the shell script to remove the out-dated log
my log file name will be like this:
access_20050101.log
access_20050102.log
.
.
.
access_20071007.log
access_20071008.log
access_20071009.log

i has try to write the command as following, it will be remove the log if older then 90 days,
but if someone has modified the log, the file timestamp will be updated
so how can i remove the log base on the file name?

find /usr/local/apache2/logs -type f -mtime +90 -exec rm -f {} \;
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 01:36 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0