El 2004-05-15 a las 19:17 +0200, Dionisio Ruiz de Zárate escribió:
esto es para rotarlo por tamaño de archivo. ¿pero para rotarlo por m3eses? cada mes? que tendría que poner?
En el manual lo dice - un ejemplo: /var/log/messages { rotate 5 weekly postrotate /sbin/killall -HUP syslogd endscript } The next section of the config files defined how to handle the log file /var/log/messages. The log will go through five weekly rotations before being removed. After the log file has been rotated (but before the old version of the log has been compressed), the command /sbin/killall -HUP syslogd will be executed. Se rota cada semana (si quieres cada mes, usa "monthly", y a las cinco rotaciones, se borra. Despues de rotar, pero antes de comprimirlo, se ejecuta ese comando: podrías correr las setadísticas perfectamente sobre el fichero de log rotado, con lo cual es estable, no hay añadidos de nuevas entradas durante el análisis. Lo unico es saber cual es el nombre del fichero. O puedes usar la opcion "copy", que crea una foto o copia del log.
y se peude antes ejecutar un comando? es decir:
¿A que no has mirado el manual? :-P prerotate/endscript The lines between prerotate and endscript (both of which must appear on lines by themselves) are executed before the log file is rotated and only if the log will actually be rotated. These directives may only appear inside of a log file definition. See postrotate as well. -- Saludos Carlos Robinson