Red Hat DIRECTORY SERVER 2.0 - GATEWAY Manual de usuario Pagina 62

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 96
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 61
Chapter 7. Logging
The three commands that specify how often rotation should take place are daily,
weekly and monthly.
rotate 4
Keep four sets of log files. The comment is slightly inaccurate; four weeks’ worth
of logs will be kept if rotation is done weekly. If rotation is done daily then this
command means that four days’ worth of logs are kept.
create
After moving the main log file from logfile to logfile.1 a new, empty
logfile should be created.
include /etc/logrotate.d
This command instructs the log rotation program to read in every file in this
directory. One of these files will correspond to the web server’s log files.
/var/log/httpd/*log {
missingok
notifempty
sharedscripts
postrotate
/bin/kill -HUP ‘cat /var/run/httpd.pid 2>/dev/null‘ 2> /dev/null || true
endscript
}
Figure 7-16. /etc/logrotate.d/httpd
The /etc/logrotate.d/httpd file (part of the httpd package), not the logrotate
package, contains the instructions specific to the web server logs.
/etc/logrotate.d/httpd: commands
/var/log/httpd/*log { ... }
This specifies that the commands within the curly brackets are to be applied to
all the files that match the expression /var/log/httpd/*log.
missingok
This is the instruction not to return an error if a particular log file is not present.
notifempty
This command instructs the system not to rotate the logs if the current main log
file is empty. See the discussion below about whether this is a good idea or not.
sharedscripts
Further down we will see a shell script that will be run after the rotatiopn has
happened. This command instructs the system to run that script only once after
all the files matching /var/log/httpd/*log have been rotated and not after
each individual rotation.
postrotate ... endscript
Following the rotation of a log file (or all of them if sharedscripts is invoked)
the commands between postrotate and endscript are run. This rotation program
runs as root so care must be taken with the commands that appear here.
58
Vista de pagina 61
1 2 ... 57 58 59 60 61 62 63 64 65 66 67 ... 95 96

Comentarios a estos manuales

Sin comentarios