is a program that should be scheduled to run periodically by
When it is executed it archives log files if necessary.
If a log file is determined to require archiving,
rearranges the files so that
the last period's logs in it,
has the next to last
period's logs in it, and so on, up to a user-specified number of
The archived logs may be optionally compressed to save space.
The options are as follows:
into which archived log files will be written.
is a relative path, it is appended to the parent directory
of each log and the archived log is stored in the result.
If an absolute path is given, all archived logs are stored in the given
does not exist for a specified log, it is ignored for that entry and
the log is rotated as if the
option was not specified.
to trim logs regardless of the size and/or age requirements specified in
This option may be combined with the
flags to aid in debugging problems with
for the configuration file.
Monitoring mode; only entries marked with an
in flags are processed.
For each log file being monitored, any log output since the last time
was run with the
flag is mailed to the user listed in the monitor notification section.
Do not trim the logs, but instead print out what would be done if this option
were not specified.
Removes the restriction that
must be running as root.
Note that in this mode
will not be able to send a
in verbose mode.
In this mode it will print out each log and its
reasons for either trimming that log or skipping it.
If one or more
files are specified on the command line, only the specified logs will
Note that each
specified must have an entry in
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
is dependent on how often it is scheduled to run in
Since the program is quite fast, it may be scheduled to run every hour
without any ill effects.
When starting up,
reads in a configuration file to determine which logs should be looked
By default, this configuration file is
Each line of the file contains information about a particular log file
that should be handled by
Each line has five mandatory fields and up to three optional fields, with
whitespace separating each field.
Blank lines or lines beginning with a hash mark
The fields of the configuration file are as
The full pathname of the system log file to be archived.
This optional field specifies the owner and group for the archive file.
is essential, even if the
field is left blank.
The fields may be numeric, or a name which is looked up
in the system password and group databases.
For backwards compatibility, a
may be used instead of a
is not specified, the owner and/or group of the existing log file is used.
File mode (in octal) to use for created log files and archives.
The number of archives to be kept besides the log file itself.
When the size of the log file (in kilobytes) reaches this point, the log
file is trimmed as described above.
If this field is replaced by an
or set to
then the size of
the log file is not taken into account when determining when to trim the
By default, files smaller than 512 bytes are not rotated unless the
(binary) flag is set or the
option is specified.
from rotating files consisting solely of a message indicating
that the log file has been turned over.
field can consist of an interval, a specific time, or both.
field consists of an asterisk
log rotation will depend only on the contents of the
field consists of an optional interval in hours, possibly followed
and a time in a restricted
format or by a
and a time specification for logfile rotation at a fixed time once
per day, per week or per month.
If a time is specified, the log file will only be trimmed if
is run within one hour of the specified time.
If an interval is specified, the log file will be trimmed if that
many hours have passed since the last rotation.
When both a time and an interval are specified, both conditions
must be satisfied for the rotation to take place.
There is no provision for the specification of a time zone.
There is little point in specifying an explicit minutes or seconds
component in the current implementation, since the only comparison is
within the hour.
ISO 8601 restricted time format:
The lead-in character for a restricted
time is an
The particular format of the time in restricted
.Oo Oo Oo Oo Oo
.Oo Li \&T
.Oo Va \&hh
.Oo Va \&mm
.Oo Va \&ss
.Oc Oc Oc Oc Oc .
Optional date fields default to the appropriate component of the
current date; optional time fields default to midnight.
For example, if today is January 22, 1999, the following date specifications
are all equivalent:
Day, week and month time format:
The lead-in character for day, week and month specification is a
The particular format of day, week and month specification is:
Optional time fields default to midnight.
The ranges for day and hour specifications are:
hours, range 0 ... 23
day of week, range 0 ... 6, 0 = Sunday
day of month, range 1 ... 31, or the letter
to specify the last day of the month.
rotate every night at midnight
rotate every day at 23:00 hr
rotate every week on Sunday at 23:00 hr
rotate every week on Friday at 16:00 hr
rotate on the first day of every month at midnight
(i.e., the start of the day; same as
rotate on every 5th day of the month at 6:00 hr
field specifies if the archives should have any special processing
done to the archived log files.
flag will make the archive
files compressed to save space using
depending on compilation options.
flag means that the file is a
binary file, and so the ASCII message which
inserts to indicate the fact that the logs have been turned over
should not be included.
flag marks this entry as a monitored
flag specifies that symbolic links should be followed.
Specify the username (or email address) 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
log file as monitored.
This field is only valid when the
flag is set.
This optional field specifies a file containing the PID of a process to send a
to instead of
Specify the signal to send to the process instead of
must start with
and be the signal name, not the number, e.g.,
This optional field specifies a command to run instead of sending a signal
to the process.
The command must be enclosed in double quotes
The empty string,
can be used to prevent
from sending a signal or running a command.
You cannot specify both a command and a PID file.
If you specify a command to be run,
will not send a