.comment-link {margin-left:.6em;}

IntTech

Friday, March 26, 2010

Compressing or Removing Old Logs


The following is useful for compressing or removing files based on name.
 find $path -name "$LogFileRegEx" -exec $compress_rm {} \; & 

And this works for removing files based on age.
find $path -mtime $DaysToOld -exec rm {} \;

And they can be combined if needed.

Bookmark and Share

Google