[Tech] Logrotate sembra non funzionare

Artini Alessio AArtini@comune.pontassieve.fi.it
Mer 7 Gen 2004 11:40:56 CET


Tornato oggi dalle ferie ho subito notato un "problemino".

Su una RH 7.3 kernel 2.4.18-3, ho dei problemi nell'esecuzione di logrotate
(v. 3.6.4).
Avrei impostato la rotazione dei vari log di squid con il file "squid" posto
su
/etc/logrotate.d/squid.

# cat squid
/usr1/squidlogs/access.log {
    monthly
    rotate 24
    copytruncate
    compress
    notifempty
    missingok
}
/var/log/squid/cache.log {
    weekly
    rotate 5
    copytruncate
    compress
    notifempty
    missingok
}

/var/log/squid/store.log {
    weekly
    rotate 5
    copytruncate
    compress
    notifempty
    missingok
# This script asks squid to rotate its logs on its own.
# Restarting squid is a long process and it is not worth
# doing it just to rotate logs
    postrotate
      /usr/sbin/squid -k rotate
    endscript
}

Se vado a vedere il file access.log vedo che non viene "rotato".
Ho provato ha lanciare log rotate con il seguente comando:
logrotate -dv -f /etc/logrotate.d/squid

e questo è l'output generato:

reading config file /etc/logrotate.d/squid
reading config info for /usr1/squidlogs/access.log
reading config info for /var/log/squid/cache.log
reading config info for /var/log/squid/store.log

Handling 3 logs

rotating pattern: /usr1/squidlogs/access.log  forced from command line (24
rotations)
empty log files are not rotated, old logs are removed
considering log /usr1/squidlogs/access.log
  log needs rotating
rotating log /usr1/squidlogs/access.log
renaming /usr1/squidlogs/access.log.25.gz to
/usr1/squidlogs/access.log.25.gz (rotatecount 24, logstart 1, i 25),
renaming /usr1/squidlogs/access.log.24.gz to
/usr1/squidlogs/access.log.25.gz (rotatecount 24, logstart 1, i 24),
renaming /usr1/squidlogs/access.log.23.gz to
/usr1/squidlogs/access.log.24.gz (rotatecount 24, logstart 1, i 23),
renaming /usr1/squidlogs/access.log.22.gz to
/usr1/squidlogs/access.log.23.gz (rotatecount 24, logstart 1, i 22),
renaming /usr1/squidlogs/access.log.21.gz to
/usr1/squidlogs/access.log.22.gz (rotatecount 24, logstart 1, i 21),
renaming /usr1/squidlogs/access.log.20.gz to
/usr1/squidlogs/access.log.21.gz (rotatecount 24, logstart 1, i 20),
renaming /usr1/squidlogs/access.log.19.gz to
/usr1/squidlogs/access.log.20.gz (rotatecount 24, logstart 1, i 19),
renaming /usr1/squidlogs/access.log.18.gz to
/usr1/squidlogs/access.log.19.gz (rotatecount 24, logstart 1, i 18),
renaming /usr1/squidlogs/access.log.17.gz to
/usr1/squidlogs/access.log.18.gz (rotatecount 24, logstart 1, i 17),
renaming /usr1/squidlogs/access.log.16.gz to
/usr1/squidlogs/access.log.17.gz (rotatecount 24, logstart 1, i 16),
renaming /usr1/squidlogs/access.log.15.gz to
/usr1/squidlogs/access.log.16.gz (rotatecount 24, logstart 1, i 15),
renaming /usr1/squidlogs/access.log.14.gz to
/usr1/squidlogs/access.log.15.gz (rotatecount 24, logstart 1, i 14),
renaming /usr1/squidlogs/access.log.13.gz to
/usr1/squidlogs/access.log.14.gz (rotatecount 24, logstart 1, i 13),
renaming /usr1/squidlogs/access.log.12.gz to
/usr1/squidlogs/access.log.13.gz (rotatecount 24, logstart 1, i 12),
renaming /usr1/squidlogs/access.log.11.gz to
/usr1/squidlogs/access.log.12.gz (rotatecount 24, logstart 1, i 11),
renaming /usr1/squidlogs/access.log.10.gz to
/usr1/squidlogs/access.log.11.gz (rotatecount 24, logstart 1, i 10),
renaming /usr1/squidlogs/access.log.9.gz to /usr1/squidlogs/access.log.10.gz
(rotatecount 24, logstart 1, i 9),
renaming /usr1/squidlogs/access.log.8.gz to /usr1/squidlogs/access.log.9.gz
(rotatecount 24, logstart 1, i 8),
renaming /usr1/squidlogs/access.log.7.gz to /usr1/squidlogs/access.log.8.gz
(rotatecount 24, logstart 1, i 7),
renaming /usr1/squidlogs/access.log.6.gz to /usr1/squidlogs/access.log.7.gz
(rotatecount 24, logstart 1, i 6),
renaming /usr1/squidlogs/access.log.5.gz to /usr1/squidlogs/access.log.6.gz
(rotatecount 24, logstart 1, i 5),
renaming /usr1/squidlogs/access.log.4.gz to /usr1/squidlogs/access.log.5.gz
(rotatecount 24, logstart 1, i 4),
renaming /usr1/squidlogs/access.log.3.gz to /usr1/squidlogs/access.log.4.gz
(rotatecount 24, logstart 1, i 3),
renaming /usr1/squidlogs/access.log.2.gz to /usr1/squidlogs/access.log.3.gz
(rotatecount 24, logstart 1, i 2),
renaming /usr1/squidlogs/access.log.1.gz to /usr1/squidlogs/access.log.2.gz
(rotatecount 24, logstart 1, i 1),
renaming /usr1/squidlogs/access.log.0.gz to /usr1/squidlogs/access.log.1.gz
(rotatecount 24, logstart 1, i 0),
copying /usr1/squidlogs/access.log to /usr1/squidlogs/access.log.1
truncating /usr1/squidlogs/access.log
compressing new log with: /bin/gzip  '/usr1/squidlogs/access.log.1'
removing old log /usr1/squidlogs/access.log.25.gz

rotating pattern: /var/log/squid/cache.log  forced from command line (5
rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/squid/cache.log
  log /var/log/squid/cache.log does not exist -- skipping

rotating pattern: /var/log/squid/store.log  forced from command line (5
rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/squid/store.log
  log /var/log/squid/store.log does not exist -- skipping


Da quel che vedo, per "lui", sembra tutto eseguito correttamente ma se vado
in /usr1/squidlogs
vedo solamente il file access.log e nient'altro.

Qual'è il problema???

Grazie e Auguri a tutti di Buon Anno

Alessio



Maggiori informazioni sulla lista flug-tech