Someone just asked me 'how long should we keep logs for our application', and my answer was 'until the disk is full' as there's no reason to throw them away other than running out of space.
However, standard logrotate wants us to specify a specific period + number of rotations. Is there something similar that would let us say "rotate daily, and keep as much history as you like until there is only 5% space free"?
The platform is Redhat Linux.
Best Answer
You can perhaps use firstaction or lastaction directives to call a shell script that tests for disk free space, and then run a delete on the oldest files.
Update:
Here's a Stackoverflow post on the type of script you can run:
https://stackoverflow.com/questions/7523059/remove-oldest-file-in-repository