
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Managing System Logfiles with logrotate
|
437
Running logrotate
Red Hat, Fedora, SUSE, and Debian use logrotate to handle system-log growth. Glo-
bal options and low-level (system) logfiles are addressed in /etc/logrotate.conf,and
application-specific configuration scripts are kept in /etc/logrotate.d/.
When logrotate is run, all scripts in /etc/logrotate.d are included into logrotate.conf
and parsed as one big script. This makes logrotate’s configuration very modular:
when you install an RPM or DEB package (of software that creates logs), your pack-
age manager automatically installs a script in /etc/logrotate.d, which will be removed
later if you uninstall the package.
Actually, the include directive in logrotate.conf may be used to specify
additional or different directories and files to include. In no event, how-
ever, should you remove the statement that includes /etc/logrotate.d if
you use Red Hat or Debian, both of whose package managers depend
on this directory for package-specific log-rotation scripts.
Syntax of logrotate.conf and its included scripts
There are really only two types of elements in logrotate.conf and its included scripts:
directives (i.e., options) and logfile specifications. A directive is simply a parameter or
a variable declaration; a logfile specification is ...