Some files are zipped to 1.gz
/var/log/apt/history.log.1.gz
/var/log/apt/term.log.1.gz
/var/log/mosquitto/mosquitto.log.1.gz
/var/log/mysql/error.log.1.gz
Some are not zipped, first the second level is to 2.gz
/var/log/apache2/access.log.1
/var/log/apache2/error.log.1
/var/log/apache2/other_vhosts_access.log.1
/var/log/dbconfig-common/dbc.log.1
/var/log/exim4/mainlog.1
/var/log/letsencrypt/letsencrypt.log.1
I get the errormessage sometimes in mail:
/etc/cron.daily/logrotate:
error: Compressing program wrote following message to stderr
when compressing log /var/log/mosquitto/mosquitto.log.1:
gzip: stdin: file size changed while zipping
because mosquitto appearently writes to the log while it is being rotated.
The rotate script is the default installed by debian:
/var/log/mosquitto/mosquitto.log {
rotate 7
daily
compress
size 100k
nocreate
missingok
postrotate
/usr/bin/killall -HUP mosquitto
endscript
}
I also prefer the lastest log uncompressed.
I think I have found the solution: The other scripts contained the keyword
According to the man it will delay the compression by one cycle.
You are missing this vital option to avoid file changing while in the compression phase: