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.
0 Comments:
Post a Comment
<< Home