FILE_ROTATION
=============

This package consists of the following files:
* README        - you are reading it
* file_rotation - the Perl script
* Makefile      - the installation makefile
* COPYING       - the GNU General Public License

WHAT DOES IT DO?
----------------

It mimics newsyslog but it is more general. It takes a log file and copies
it to another file with a number appended to it. The next time you call
it, it passes the previous versions to the next versions. I have made some
extensions so that I can use it for more things.

Well, my predecessor did not log too much information and there for he
did not reserve that much space on the partition where /var/log/syslog*
resides. I do log quite a bit and normally I have about 450 Meg of log
files in 9 weeks. Although there exists a Bourne shell script "newsyslog"
under Solaris (there also exists a C version on Internet), it is too
limited for my purposes.

I really want to move older log files to a different partition where there
is more space. I also wanted a different naming scheme. I like the older
files to have suffices by its date. Basically, the suffix should be as
you get with "date '+%Y-%m-%d'".

I also want to have them compressed. Furthermore, I wanted to be able
to send a HUP signal to the syslog daemon to inform it that the syslog
has been truncated. Oh, and of course I also wanted to be able to use
file_rotation for different files then the syslog files.

THINGS YOU SHOULD KNOW
----------------------

Although "newsyslog" was able to just move files around, with file_rotation
there were two possible race conditions:

* When you move the syslog to a different partition, you basically do a
  copy & unlink operation. This can take quite some time.

* Compression of a large log file can take quite some time.

In case of the syslog this was too great a risk. Now the file is first
renamed and an empty one is created, and then you can send your signal to
the daemon. After that the file that was renamed, can be copied to its
new location and the renamed file can be removed. Finally the file that
was copied can be safely compressed.

WHAT PLATFORM DO I NEED?
------------------------

Any Unix flavor running Perl (I have tested it with version 5.005_02 under
Solaris 2.5 & 2.6).

HOW TO INSTALL
--------------

0) Read the file COPYING. It applies to this package.

1) Have a look at the "Makefile" (shocking, I know :-) and change PERL,
   POD2MAN, DATE, COMPRESS, SUFFIX, and the installation directories BINDIR
   and MANDIR to your liking.

2) Say the magic words:
      make
      make install

CONTACT INFORMATION
-------------------

Hans de Vreught <J.P.M.deVreught@cs.tudelft.nl>
De Brink 70
2553 HA  The Hague
The Netherlands
