Dear Maintainer,
*** Reporter, please consider answering these questions, where appropriate ***
* What led up to the situation?
I want to change compressor for logrotate to xz
* What exactly did you do (or not do) that was effective (or
ineffective)?
So I've added to /etc/logrotate.conf following configuration:
===
# grep compress /etc/logrotate.conf
compress
compresscmd /usr/bin/xz
uncompresscmd /usr/bin/unxz
compressext .xz
compressoptions "--memlimit=150MiB --threads=0"
====
* What was the outcome of this action?
===
logrotate always using gzip when running in debug mode:
# logrotate --debug /etc/logrotate.conf
[...]
compress_prog is now /usr/bin/xz
compress_ext was changed to .xz
uncompress_prog is now /usr/bin/unxz
compress_ext is now .xz
compress_options is now "--memlimit=150MiB --threads=0"
Reading state from file: /var/lib/logrotate/status
[...]
rotating log /var/log/daemon.log, log->rotateCount is 0
dateext suffix '-20200504'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
compressing log with: /bin/gzip
renaming /var/log/daemon.log.1.gz to /var/log/daemon.log.2.gz (rotatecount 1, logstart 1, i 1),
renaming /var/log/daemon.log.0.gz to /var/log/daemon.log.1.gz (rotatecount 1, logstart 1, i 0),
renaming /var/log/daemon.log to /var/log/daemon.log.1
disposeName will be /var/log/daemon.log.1.gz
* What outcome did you expect instead?
I was sure that logrotate will change archive extension to .xz and archiver command to /usr/bin/xz, as in config file.
*** End of the template - remove these template lines ***