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:
http://www.sigwinch.xyz/hg/lr
Comments, pull requests and patches are welcome, of course.
Regards,
--
wcm
Received on Sun Jan 22 2017 - 21:48:00 CET