the logs on /var/log/
(Debian/Ubuntu) are stored as
x.log
x.log.1
x.log.2.gz
...
like kernel logs, syslogs, etc.
I see that as the log info increases, they are stored by splitting into smaller files (rather than keeping all in a single file). I wonder why the second file (x.log.1
) is not compressed? Is it something to do with accessing more recent logs easier?
Best Answer
I agree with you, that should only provide an easier access to recent files. Anyway, the actual behaviour is decided via logrotate
delaycompress
directive, which says:The historical reason can be found in the logrotate manual: