Logrotate improvement

Looking into how Vera handles logs, I noticed that they are rotated only based on time - 10 (?) minutes per file, 10 files max.

As a confirmation to that, I’ve seen MCV requesting people to call/IM within couple hours of failure to be able to catch it in the logs.

Sometimes it’s helpful to see old logs, but couple hours window is not too much when you debug something.

There are few ways to improve it. Besides normal rotation by size (let’s say logs are only rotated when the file reaches 100KB), it is also common to avoid rotating empty logs. So, if there was no activity for hours, last log file will be empty and you’d still have some logs saved from the last activity.

I guess if sources were available, I could have looked into fixing this myself…

Actually the source is on Vera itself. It’s not compiled code: /usr/bin/Rotate_Logs.sh

I made a bug report so we’ll be sure to take into account your suggestions: http://bugs.micasaverde.com/view.php?id=337