Skip to Main Content
Linux Server Security, Second Edition
book

Linux Server Security, Second Edition

by Michael D. Bauer
January 2005
Intermediate to advanced content levelIntermediate to advanced
544 pages
23h 44m
English
O'Reilly Media, Inc.
Content preview from Linux Server Security, Second Edition
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 its 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 doesnt
exist.
missingok cancels this behavior (i.e., ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Linux: Powerful Server Administration

Linux: Powerful Server Administration

Uday Sawant, Oliver Pelz, Jonathan Hobson, William Leemans
Linux Server Hacks

Linux Server Hacks

Rob Flickenger
Linux Server Hacks, Volume Two

Linux Server Hacks, Volume Two

William von Hagen, Brian K. Jones

Publisher Resources

ISBN: 0596006705Supplemental ContentCatalog PageErrata