[dev][announce] lr: tiny log rotater

From: Wolfgang Corcoran-Mathe <wcm_AT_sigwinch.xyz>
Date: Sun, 22 Jan 2017 15:48:00 -0500

Hi all,

I’ve written a simple log rotation program. It rotates a given file
through n backups, appending a numeric suffix. Logs may also be piped
through a command, and an optional suffix may be appended.

lr is static and is configured solely through command-line flags.
There is no built-in support for periodic rotation (e.g. every two
weeks, or when a file has reached a given size), which is better
handled by external utilities.

It is a very boring program. Unlike logrotate, however, it is
fairly sane.


Rotate /var/log/messages through 3 backups (messages.[1-3]):

    lr -n 3 /var/log/messages

Pipe each backup through bzip2 and add .bz2 suffix:

    lr -n 3 -c bzip2 -s .bz2 /var/log/messages

Mercurial repository:


Comments, pull requests and patches are welcome, of course.


Received on Sun Jan 22 2017 - 21:48:00 CET

This archive was generated by hypermail 2.3.0 : Sun Jan 22 2017 - 22:00:16 CET