Rotate Logs


Traditionally log file management on Unix hosts is generally not well catered for. Various log files tend to go unnoticed until a file system fills.

I wrote rotatelogs sometime ago to provide a single point for log management on Solaris systems. It features:

  • Rotation based on daily, weekly or monthly directives.
  • Compression of old files.
  • Specify number of old logs to keep.
  • Pre and post processing of logs, eg: run webstats.

    The rotatelogs script should be run as a cronjob once a night. The rotate.conf file contains the schedules for all the log files you want to manage.

    rotatelogs script
    sample rotate.conf file
    Tar file with the script and conf file


    Changes

    30 May 1999
    The following changes gratefully supplied by Brent Nordquist.

    2 May 1995
    Original version hacked up with a few minor changes over the years.


    Ginini Technologies Software