<!DOCTYPE html> <html> <head> </head> <body> <p><strong>#Rotazione log con il comando logrotate</strong></p> <p>Le configurazioni singole dei rotate log sono nella cartella /etc/logrotate.d<br />Bisogna creare i file specificando nella prima riga su quale log file dovrà operare.</p> <p><em>Questo che segue è un esempio di script (file > /etc/logrotate.d/modsec)</em></p> <p>/var/log/apache2/modsec_audit.log {<br />rotate 1<br />compress<br />missingok<br />notifempty<br />sharedscripts<br />postrotate<br />service apache2 restart<br />endscript<br />}</p> <p><strong>Il file di configurazione cron giornaliero è il seguente /etc/cron.daily/logrotate</strong></p> <p>rotate 1 > tells logrotate to keep ONLY 1 copy of the file. This means that today at 4 am logrotates deletes the file modsec_audit.log.1.gz <br />and creates a new one starting from modsec_audit.log.</p> <p>compress > means that we do want a compressed archive of the file</p> </body> </html>
Subscribe
0 Comments
Oldest