添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Hello,

Code: Select all

root@backup[10.10.10.21] ~ # cat /etc/logrotate.d/infomaniak 
/var/log/infomaniak/* {
  rotate 31         # Garder les logs du mois
  daily             # Rotation quotidienne
  dateext           # Extension en date plutôt qu'en chiffre
  dateyesterday     # La date est celle des événements non de la création du log
  delaycompress     # Ne pas compresser tout de suite
  ifempty           # Faire la rotation même si le fichier est vide 
  nomail            # Pas la peine d'envoyer par mail.
root@backup[10.10.10.21] ~ # 
My logs should rotate everyday, but they're not and the logs are growing larger. I also tried to launch logrotate by hand like this to no avail :

Code: Select all

logrotate /etc/logrotate.conf
Here's my logrotate.conf. On line 11 it's supposed to load my logrotate config fle.

Code: Select all

root@backup[10.10.10.21] ~ # nl /etc/logrotate.conf 
     1  # see "man logrotate" for details
     2  # rotate log files weekly
     3  weekly
     4  # keep 4 weeks worth of backlogs
     5  rotate 4
     6  # create new (empty) log files after rotating old ones
     7  create
     8  # uncomment this if you want your log files compressed
     9  #compress
    10  # packages drop log rotation information into this directory
    11  include /etc/logrotate.d
    12  # no packages own wtmp, or btmp -- we'll rotate them here
    13  /var/log/wtmp {
    14      missingok
    15      monthly
    16      create 0664 root utmp
    17      rotate 1
    18  }
    19  /var/log/btmp {
    20      missingok
    21      monthly
    22      create 0660 root utmp
    23      rotate 1
    24  }
    25  # system-specific logs may be configured here
root@backup[10.10.10.21] ~ # 
Here's the content of that directory 

Code: Select all

root@backup[10.10.10.21] ~ # ls /etc/logrotate.d/
total 68K
-rw-r--r-- 1 root root  326 Feb  1  2014 apache2
-rw-r--r-- 1 root root  173 Nov 16  2013 apt
-rw-r--r-- 1 root root   79 Nov  7  2012 aptitude
-rw-r--r-- 1 root root  209 Apr 29  2014 clamav-daemon
-rw-r--r-- 1 root root  230 Apr 29  2014 clamav-freshclam
-rw-r--r-- 1 root root  232 Sep 30  2013 dpkg
-rw-r--r-- 1 root root  146 Jan  2  2013 exim4-base
-rw-r--r-- 1 root root  126 Jan  2  2013 exim4-paniclog
-rw-r--r-- 1 root root  338 Jun 12  2013 fail2ban
-rwxr-xr-x 1 root root  440 Feb  4 17:52 infomaniak
-rw-r--r-- 1 root root 1.6K Jun 16  2012 mailman
-rw-r--r-- 1 root root  880 Jan 20  2014 mysql-server
-rw-r--r-- 1 root root  163 Apr 18  2014 php5-fpm
-rw-r--r-- 1 root root 1014 Oct  8  2012 pure-ftpd-common
-rw-r--r-- 1 root root  162 May 26  2012 rkhunter
-rw-r--r-- 1 root root  515 Mar  5  2013 rsyslog
-rw-r--r-- 1 root root  111 Jun 28  2012 suphp-common
root@backup[10.10.10.21] ~ # 
infomaniak (the config file) is readable.
Any help appreciated. Thanks ;)
You might try making the permissions on /etc/logrotate.d/infomaniak the same as all the other files in that directory.
Also, man logrotate warns about using the * wildcard as you have done there, you might want to check that out.
You might try making the permissions on /etc/logrotate.d/infomaniak the same as all the other files in that directory.
You were right, my file wasn't even loaded. Then when I changed permissions (chmod -x) I started seeing the errors on the console when launching logrotate manually

Code: Select all

root@backup[10.10.10.21] ~ # logrotate /etc/logrotate.conf 
error: infomaniak:2 bad rotation count '31         # Garder les logs du mois'
error: found error in /var/log/infomaniak/main.log , skipping
error: stat of /var/log/infomaniak/main.log failed: No such file or directory
root@backup[10.10.10.21] ~ #
I removed the comments that were at the end of line and added a "create" directive because without it the logfile would disappear.
  • ↳   General Questions
  • ↳   Graphical Environments & Desktops
  • ↳   System and Network configuration
  • ↳   Hardware
  • ↳   Programming
  • Testing & Unstable
  • ↳   Testing And Unstable
  • Debian User Projects
  • ↳   Debian User Projects - Software
  • ↳   Debian User Projects - Media
  • Community
  • ↳   Forum information, requests, and feedback.
  • ↳   General Debian
  • ↳   Off-Topic
  •