
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Using Swatch for Automated Log Monitoring
|
439
Running logrotate
Usually, logrotate is invoked by the script /etc/cron.daily/logrotate, which consists of
a single command:
/usr/sbin/logrotate /etc/logrotate.conf
This doesn’t necessarily mean that logs are rotated daily; it means that logrotate
checks each logfile daily against its configuration script and rotates or doesn’t rotate
the logfile accordingly.
If you want logrotate to be run less frequently, you can move this script to /etc/cron.
weekly or even /etc/cron.monthly (though the latter is emphatically not recom-
mended unless logrotate is, for some strange reason, configured to rotate each and
every file monthly).
Using Swatch for Automated Log Monitoring
Okay, you’ve painstakingly configured, tested, and fine-tuned your system logger to
sort system messages by type and importance and then log them both to their
ifempty | notifempty
By default, logrotate rotates a file even if it’s empty.
notifemptycancels thisbehavior; ifemptyrestoresit (e.g.,
overriding a global
notifempty setting).
include file_or_directory
When parsing logrotate.conf, include the specified file or the
files in the specified directory.
missingok | nomissingok
By default, logrotate will return a message if a logfile doesn’t
exist.
missingok cancels this behavior (i.e., ...