What to do with those ever-growing log files? I initially decided to rotate the logs once a month. The trouble is, once you start a new log, you lose the ability to generate history display via the web interface. (New log file == no historic data!)
I decided that what I really wanted was a way to keep the size of my logs under control by purging old entries from the log files. This Perl script (dspam-logrotate.pl) will do that for you. I run it nightly as a cron job. It should be run as the dspam user so that new log files are created with the correct owner and group IDs.
You specify the age threshold and the log files to be processed on the command line. For example, if you specify -age 14, all log file entries older than 14 days will be removed from the file.
There is also a -v option that causes the script to tell you the number of entries removed from each log file it processes.
I keep a month's worth of data in my system log and two weeks worth in each user log:
The author of this submission hereby releases any and all copyright interest in this code, documentation, or other materials included to the DSPAM project and its primary governors. I intend this relinquishment of copyright interest in perpetuity of all present and future rights to said submission under copyright law.