README for <shrotate>
Introduction
<shrotate> is a utility for rotation of log files. It uses the GNU shtool for making the rotation.
There are many log rotation tools out there, most of them come with the operating system and are, in most cases, not portable. That means, if you know 'newsyslog' of freebsd, this doesn't help you if you are on solaris. The same applies if you know 'logrotate' of Redhat linux and are on Debian linux, which has it's own thing (savelog, for the curious).
This situation annoyed me. And perhaps it annoys you, too. If yes - read on.
Some day I wanted to port the Redhat 'logrotate' tool to FreeBSD and Solaris. But, you guess, it didn't work. It's a totally 'linuxish' piece of software. You probably know this, of course it compiles on linux, but they never tried it on a true uni*x system :-)
But there was a solution, I found that the new GNU 'shtool' has a new command, 'rotate', which does what I needed. And it does the job the way I need it. And it is portable :-)
On the other hand - I really like the configuration of the Redhat logrotate, so I decided to write a wrapper which supports such a configuration file, which was required anyway, because 'shtool' does not support a configuration file, it will be controlled via the commandline.
The result is <shrotate>. It reads a configuration file (which has, btw, more capabilities as the Redhat 'logrotate' "template"), and creates 'shtool' commandlines based on the configuration and finally executes them.
Installation
Make sure you have the latest 'shtool' installed. It must be version 1.5.4 or higher. You can find it out by entering:
# shtool -v
Edit the Makefile if you like and enter this command:
# make install
The binary 'shrotate' will be installed by default to /usr/bin.
The sample configuration file will be placed in /etc and named 'shrotate.conf.dist' to make sure it does not interfere a possibly existing shrotate installation. Edit this file and move it to 'shrotate.conf' if you are done.
Now add a crontab entry for 'shrotate':
# rotate every month once
5 00 1 * * /usr/bin/shrotate -d > /var/log/shrotate.log 2>&1
(note: the -d flag turns debugging output on, which might be usefull sometimes).
Documentation
You will find the complete documentation of <shrotate> in the manpage, just type:
# man shrotate
The distribution tarball contains a sample config which you can use as a starting point.
Copyright
(c) 2002 Copyright Thomas Linden <tom@daemon.de>
License
Artistic License. See the file COPYING for details.
Authors
Thomas Linden <scip@daemon.de>
$Id$
