Lighttp: Rotatia logurilor folosind logrotate

Ultima oara am scris un articol despre configurarea lighttpd pentru a folosii mai multe domenii

Vrem ca logurile noastre sa fie rotate utilizand logrotate. In config-ul nostru avem de a face cu 6 fisiere de log:

Logurile domeniului default/IP:

Logurile domeniului server1.com:

Logurile domeniului server2.com:

Configurare logrotate

Tot ce trebuie sa facem e sa deschidem /etc/logrotate.d/lighttpd si sa adaugam:

# vi /etc/logrotate.d/lighttpd”/var/log/lighttpd/*.log” “/var/log/lighttpd/server1.com/*.log ” /var/log/lighttpd/server2.com/*.log {
missingokcopytruncate

rotate 7

compress

notifempty

sharedscripts

postrotate

/etc/init.d/lighttpd reload

endscript

}

Fii sigur ca logrotate porneste dupa fiecare reboot

Did you enjoy this post? Why not leave a comment below and continue the conversation, or subscribe to my feed and get articles like this delivered automatically to your feed reader.

Comments

No comments yet.

Leave a comment

(required)

(required)