NEWSYSLOG(8)            OpenBSD System Manager's Manual           NEWSYSLOG(8)

NAME
     newsyslog - maintain system log files to manageable sizes

SYNOPSIS
     newsyslog [-mnrv] [-f config_file]

DESCRIPTION
     newsyslog is a program that should be scheduled to run periodically by
     cron(8). When it is executed it archives log files if necessary.  If a
     log file is determined to require archiving, newsyslog rearranges the
     files so that logfile is empty, logfile.0 has the last period's logs in
     it, logfile.1 has the next to last period's logs in it, and so on, up to
     a user-specified number of archived logs.  Optionally the archived logs
     can be compressed to save space.

     The options are as follows:

     -m      Monitoring mode; only entries marked with an `M' in flags are
             processed, and notifications sent if any have changed.  Without
             this option, monitored entries are not processed.

     -n      Do not trim the logs, but instead print out what would be done if
             this option were not specified.

     -r      Removes the restriction that newsyslog must be running as root.
             Of course, newsyslog will not be able to send a SIGHUP signal to
             syslogd(8), so this option should only be used in debugging.

     -v      Be verbose.  In this mode it will print out each log and its rea-
             sons for either trimming that log or skipping it.

     -f config_file
             Use config_file instead of /etc/newsyslog.conf for the configura-
             tion file.

     A log can be archived because of two reasons.  The log file can have
     grown bigger than a preset size in kilobytes, or a preset number of hours
     may have elapsed since the last log archive.  The granularity of newsys-
     log is dependent on how often it is scheduled to run in cron(8). Since
     the program is quite fast, it may be scheduled to run every hour without
     any ill effects.

     When starting up, newsyslog reads in a configuration file to determine
     which logs should be looked at.  By default, this configuration file is
     /etc/newsyslog.conf. Each line of the file contains information about a
     particular log file that should be handled by newsyslog. Each line has
     five mandatory fields and up to three optional fields, with a whitespace
     separating each field.  Blank lines or lines beginning with a hash mark
     (`#') are ignored.  The fields of the configuration file are as follows:

     logfile name      The full pathname of the system log file to be
                       archived.

     owner.group of archives (optional)
                       Specify an ownership and group for the archive file.
                       The `.' is essential, even if the owner or group field
                       is left blank.  The fields may be numeric, or a name
                       which is looked up in the system password and group
                       databases.

     mode of logfile & archives


                       Octal mode of created log files and archives.

     number of archives
                       Specify the number of archives to be kept besides the
                       log file itself.

     size of archives  When the size of the log file reaches this point, the
                       log file becomes trimmed as described above.  If this
                       field is replaced by a `*', then the size of the log
                       file is not taken into account when determining when to
                       trim the log file.

     archive interval  Specify the time separation between the trimming of the
                       log file.  If this field is replaced by a `*', the num-
                       ber of hours since the last time the log was trimmed
                       will not be taken into consideration.

     flags (optional)  The flags field specifies if the archives should have
                       any special processing done to the archived log files.
                       The `Z' flag will make the archive files compressed to
                       save space using gzip(1) or compress(1), depending on
                       compilation options.  The `B' flag means that the file
                       is a binary file, and so the ASCII message which
                       newsyslog inserts to indicate the fact that the logs
                       have been turned over should not be included.  The `M'
                       flag marks this entry as a monitored log file.

     monitor notification (optional)
                       Specify the account that should receive notification
                       messages if this is a monitored log file.  Notification
                       messages are sent as email; the operator deserves what
                       they get if they mark the sendmail(8) log file as moni-
                       tored.

     pid file (optional)
                       Specify a file containing the PID of a process to send
                       a SIGHUP signal to instead of /var/run/syslog.pid.

     signal (optional)
                       Specify the signal to send to the process instead of
                       SIGHUP. Signal names must start with ``SIG'' and be the
                       signal name, not the number, e.g., SIGUSR1.

     command (optional)
                       Specify a command to run instead of sending a signal to
                       the process.  The command must be enclosed in double
                       quotes (`"')). You cannot specify both a command and a
                       PID file.  NOTE: If you specify a command to be run,
                       newsyslog will not send a SIGHUP to syslogd(8).

FILES
     /etc/newsyslog.conf  default configuration file

SEE ALSO
     compress(1), gzip(1), syslog(3), syslogd(8)

AUTHORS
     Theodore Ts'o, MIT Project Athena
     Copyright 1987, Massachusetts Institute of Technology

OpenBSD 3.0                    November 11, 1999                             2
