|
freebsd man page --- newsyslog(1) host100# man newsyslog Formatting page, please wait...Done. NEWSYSLOG(8) FreeBSD System Manager's Manual NEWSYSLOG(8)
NAME newsyslog - maintain system log files to manageable sizes
SYNOPSIS newsyslog [-Fnrv] [-f config_file] [-a directory] [file ...]
DESCRIPTION The newsyslog utility 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.
A log can be archived for three reasons:
1. It is larger than the configured size (in kilobytes). 2. A configured number of hours have elapsed since the log was last archived. 3. This is the specific configured hour for rotation of the log.
The granularity of newsyslog is dependent on how often it is scheduled to run by cron(8). Since the program is quite fast, it may be scheduled to run every hour without any ill effects, and mode three (above) assumes that this is so.
When starting up, newsyslog reads in a configuration file to determine which logs may potentially be archived. 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 four optional fields, with whitespace separating each field. Blank lines or lines beginning with ``#'' are ignored. If ``#'' is placed in the middle of the line, ``#'' character and the rest of the line after it is ignored. To prevent special meaning, the ``#'' may be escaped with ``'', in this case preceding ``'' is removed and ``#'' treated as ordinary character. The fields of the configuration file are as follows:
|