Salve a tutti,
ho uno strano problema con i log di sistema. Sulla macchina che utilizzo al lavoro raggiungono dimensioni assurde:
du /var/log/* |grep M 690M /var/log/kernel 691M /var/log/messages 691M /var/log/syslog
contengono mesi di log e ne viene salvato solo uno vecchio (kernel.1 etc), che ho appena cancellato per evidenti problemi di spazio.
Sulla macchina di casa, invece, ho quattro file "storici" e tutti di dimensioni ragionevoli.
Quello che mi mette in crisi è il fatto che i due file /etc/logrotate sono assolutamente identici :-0
Cosa è che regola la gestione dei file di log?
Probabilmente, da qualche parte c'è scritto di leggere un altro file al posto di logrotate.conf. Dove?
Questo è il mio attuale logrotate.conf che sembra assolutamente innocuo
# Mandriva logrotate configuration # $Id: logrotate.conf 533703 2010-04-12 15:43:25Z eugeni $ # rotate log files weekly weekly # keep 4 weeks worth of backlogs rotate 4 # create new (empty) log files after rotating old ones create # allow missing log missingok # do not rotate empty files notifempty # uncomment this if you want your log files compressed compress delaycompress # RPM packages drop log rotation information into this directory include /etc/logrotate.d # no packages own lastlog, wtmp, or btmp -- we'll rotate them here /var/log/wtmp { create 0664 root utmp rotate 1 } /var/log/btmp { create 0600 root utmp rotate 1 } # system-specific logs may be configured here
ciao e grazie per le risposte, Andrea
Ciao Andrea,
per vedere lo stato del logrotate sul tuo pc:
cat /var/lib/logrotate.status
invece il cron che lo lancia :
/etc/cron.daily/logrotate
nota che /etc/cron.daily puoi eseguirlo manualmente e vedere cosa succede.
Controlla anche che il crontab sia impostato cosi:
cat /etc/crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
# run-parts
01 * * * * root nice -n 19 run-parts --report /etc/cron.hourly
02 4 * * * root nice -n 19 run-parts --report /etc/cron.daily
22 4 * * 0 root nice -n 19 run-parts --report /etc/cron.weekly
42 4 1 * * root nice -n 19 run-parts --report /etc/cron.monthly
Fammi sapere cosa scopri.
Ciao
Armando
2010.2 Official - KDE 4.4.2 - Gnome 2.30.0 -- kernel 2.6.36.2 server on HP Pavilion dv5- AMD Athlon x2 - only official repo