Re: [dev][announce] lr: tiny log rotater

From: Alexander Krotov <>
Date: Mon, 23 Jan 2017 00:53:57 +0300

On Sun, Jan 22, 2017 at 03:48:00PM -0500, Wolfgang Corcoran-Mathe wrote:
> 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.
> Examples:
> 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.
> Regards,
> --
> wcm

Just noticed I have no log rotation on my desktop at all and still only
16M of logs.

Just tried this one: lr -n 3 /var/log/messages moved the file to
/var/log/messages.1, but messages are still added to messages.1, not
messages. Is it intended? Looks like just relinking the file does not
work as expected, you also have to do "killall -HUP syslog-ng" or
whatever you use.

Added this one to cron.daily:

  lr -n 3 /val/log/messages
  killall -HUP syslog-ng

Might want to add it to readme.

As for license, you may want to use

> If the laws in your area are brain-damaged
Copyright laws are brain-damaged almost everywhere with respect to
public domain and link to wikipedia about ISC license instead of actual
license text is even less likely to have any legal effect than public
domain dedication.
Received on Sun Jan 22 2017 - 22:53:57 CET

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