LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Can logrotate set limits on archived file size? (https://www.linuxquestions.org/questions/linux-server-73/can-logrotate-set-limits-on-archived-file-size-633099/)

0xdefec8 04-04-2008 03:43 PM

Can logrotate set limits on archived file size?
 
This is my problem: logrotate works great at limiting how often I want to rotate my logs based on size and/or date. And it lets me limit how many old copies of logs I want to keep.

My problem is that the total size of my archived logs occasionally gets too large. I can set a limit on how many old copies I want, but not how large to allow them to grow. And yes, I compress them.

Is there a way to limit their size within logrotate?

Thanks!

jonesr 04-05-2008 08:22 PM

It does feel like something that logrotate should be able to do with a single directive, but I know of no other way than to write a script to prune however you like, then call it from a "prerotate" or "postrotate" section.


All times are GMT -5. The time now is 07:16 PM.