Package: logrotate Version: 3.8.7-1+b1 Severity: normal Dear Maintainer,
logrotate does not seem to process %V (week number), when added in dateext. See the following output: ----------- rotating pattern: /var/log/nginx/*.log forced from command line (52 rotations) empty log files are rotated, old logs are removed considering log /var/log/nginx/access.log log needs rotating considering log /var/log/nginx/error.log log needs rotating rotating log /var/log/nginx/access.log, log->rotateCount is 52 Converted ' _%Y_%V' -> '_%Y_%%V' dateext suffix '_2018_%V' glob pattern '_[0-9][0-9][0-9][0-9]_%V' compressing log with: /usr/bin/lzop destination /var/log/nginx/access.log_2018_%V already exists, skipping rotation rotating log /var/log/nginx/error.log, log->rotateCount is 52 Converted ' _%Y_%V' -> '_%Y_%%V' dateext suffix '_2018_%V' glob pattern '_[0-9][0-9][0-9][0-9]_%V' compressing log with: /usr/bin/lzop destination /var/log/nginx/error.log_2018_%V already exists, skipping rotation ----------- Logroate for nginx is configured as follows (vim /etc/logrotate.d/nginx) /var/log/nginx/*.log { weekly missingok rotate 52 compress delaycompress create 0640 www-data adm sharedscripts prerotate if [ -d /etc/logrotate.d/httpd-prerotate ]; then \ run-parts /etc/logrotate.d/httpd-prerotate; \ fi \ endscript postrotate invoke-rc.d nginx rotate >/dev/null 2>&1 endscript dateext dateformat _%Y_%V compresscmd /usr/bin/lzop compressoptions -U -9 compressext .lzo } I was expecting logrotate to be able interpret any dateformats, which are specified in man date - in this case the weeknumber. -- Package-specific info: Contents of /etc/logrotate.d total 40 -rw-r--r-- 1 root root 406 Feb 9 00:42 apt -rw-r--r-- 1 root root 197 Feb 9 00:42 aptitude -rw-r--r-- 1 root root 237 Feb 9 00:41 emby-server -rw-r--r-- 1 root root 378 Feb 9 00:42 fail2ban -rw-r--r-- 1 root root 203 Feb 9 00:43 iptables -rw-r--r-- 1 root root 440 Feb 9 00:48 nginx -rw-r--r-- 1 root root 351 Dec 26 17:25 nginx.dpkg-dist -rw-r--r-- 1 root root 209 Feb 6 18:08 plexdrive -rw-r--r-- 1 root root 308 Feb 4 19:03 ramdisks -rw-r--r-- 1 root root 729 Feb 4 19:02 rsyslog -- System Information: Debian Release: 8.10 APT prefers oldstable-updates APT policy: (500, 'oldstable-updates'), (500, 'oldstable') Architecture: amd64 (x86_64) Kernel: Linux 3.16.0-5-amd64 (SMP w/12 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to en_US.UTF-8) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) Versions of packages logrotate depends on: ii base-passwd 3.5.37 ii cron [cron-daemon] 3.0pl1-127+deb8u1 ii libacl1 2.2.52-2 ii libc6 2.19-18+deb8u10 ii libpopt0 1.16-10 ii libselinux1 2.3-2 Versions of packages logrotate recommends: ii bsd-mailx [mailx] 8.1.2-0.20141216cvs-2 logrotate suggests no packages. -- Configuration Files: /etc/logrotate.conf changed: daily rotate 30 create compress include /etc/logrotate.d /var/log/wtmp { missingok monthly create 0664 root utmp rotate 12 dateext dateformat _%Y-%m } /var/log/btmp { missingok monthly create 0660 root utmp rotate 12 dateext dateformat _%Y-%m } -- no debconf information