Turning a log file into a sort of circular buffer

Posted by pachanga on Server Fault See other posts from Server Fault or by pachanga
Published on 2010-04-17T07:24:39Z Indexed on 2010/04/17 7:33 UTC
Read the original article Hit count: 533

Filed under:

Folks, is there a *nix solution which would make the log file act as a circular buffer? For example, I'd like log files to store maximum 1Gb of data and discard the older entries once the limit is reached.

Is it possible at all? I believe in order to achieve that a log file should be turned into some sort of special device...

P.S. I'm aware of misc logrotating tools but this is not what I need. Logrotating requires lots of IO, happens usually once a day while I need a "runtime" solution.

© Server Fault or respective owner

Related posts about logs