Como uso logrotate para remover tarballs de log antigos?

0

Estou usando o Ubuntu 14.04. Eu quero girar arquivos de log diariamente, incluindo a exclusão de tarballs antigos. Eu editei meu arquivo logrotate.conf, /etc/logrotate.conf, assim

/home/rails/myproject/log {
        daily
        rotate 4
        compress
        delaycompress
        missingok
        notifempty
        create 644 root root
}

Isto tem sido assim há algum tempo (alguns meses pelo menos), mas eu ainda vejo tarballs de dezembro

myuser@myproject:~$ ls -al /home/rails/myproject/log/
total 8621332
drwxr-xr-x  2 rails rails       4096 Apr 10 19:27 .
drwxr-xr-x 15 rails rails       4096 Apr 10 10:18 ..
-rw-rw-r--  1 rails rails          0 Nov  1 16:33 development.log
-rw-rw-r--  1 rails rails          0 Oct 22 15:12 .keep
-rw-r--r--  1 rails rails 8583649390 Apr 10 19:09 production.log
-rw-r--r--  1 rails rails    4213027 Dec 31 06:55 production.log.1
-rw-r--r--  1 rails rails     887381 Dec 13 06:29 production.log.10.gz
-rw-r--r--  1 rails rails     639810 Dec 12 06:41 production.log.11.gz
-rw-r--r--  1 rails rails    1034755 Dec 11 06:41 production.log.12.gz
-rw-r--r--  1 rails rails     824498 Dec 10 06:28 production.log.13.gz
-rw-r--r--  1 rails rails     686155 Dec  9 06:53 production.log.14.gz
-rw-r--r--  1 rails rails     634700 Dec  8 06:42 production.log.15.gz
-rw-r--r--  1 rails rails       4277 Dec  7 06:35 production.log.16.gz
-rw-r--r--  1 rails rails   33388963 Dec  6 06:50 production.log.17.gz
-rw-r--r--  1 rails rails   42522255 Dec  5 06:44 production.log.18.gz
-rw-r--r--  1 rails rails   25831496 Dec  4 06:25 production.log.19.gz
-rw-r--r--  1 rails rails     184096 Dec  3 06:45 production.log.20.gz
-rw-r--r--  1 rails rails     313414 Dec  2 06:31 production.log.21.gz
-rw-r--r--  1 rails rails     306576 Dec  1 06:42 production.log.22.gz
-rw-r--r--  1 rails rails     441101 Nov 30 06:40 production.log.23.gz
-rw-r--r--  1 rails rails     264538 Nov 29 06:27 production.log.24.gz
-rw-r--r--  1 rails rails    1121126 Nov 28 06:31 production.log.25.gz
-rw-r--r--  1 rails rails   13990139 Nov 27 06:35 production.log.26.gz
-rw-r--r--  1 rails rails   34321217 Nov 26 06:38 production.log.27.gz
-rw-r--r--  1 rails rails   10963566 Nov 25 06:53 production.log.28.gz
-rw-r--r--  1 rails rails   69216879 Nov 24 06:29 production.log.29.gz
-rw-r--r--  1 rails rails       2340 Dec 30 06:30 production.log.2.gz
-rw-r--r--  1 rails rails       2624 Dec 29 06:38 production.log.3.gz
-rw-r--r--  1 rails rails       6354 Dec 28 06:46 production.log.4.gz
-rw-r--r--  1 rails rails    1113173 Dec 27 06:41 production.log.5.gz
-rw-r--r--  1 rails rails     163933 Dec 16 06:30 production.log.7.gz
-rw-r--r--  1 rails rails     309826 Dec 15 06:51 production.log.8.gz
-rw-r--r--  1 rails rails    1070471 Dec 14 06:53 production.log.9.gz

Existe outra opção que eu preciso adicionar que fará com que os tarballs antigos sejam excluídos? Fico feliz se os arquivos com mais de 7 dias forem removidos do sistema de arquivos.

    
por Dave 11.04.2017 / 01:31

0 respostas