4

On a current Debian Testing machine, I am wanting to use xz to compress log files instead of GZip. It has higher compression out of the box, and as such I wish to use it.

However, whenever I specify it in the logrotate configurations, logrotate says that it can't utilize xz to compress. It just says the file can't be executed, even though it works everywhere else on the system and in user shell.

Is there any way to debug this?

Thomas Ward
  • 2,600
  • 2
  • 18
  • 31

1 Answers1

7

You can try adding the below to /etc/logrotate.conf:

compresscmd /usr/bin/xz
uncompresscmd /usr/bin/unxz
compressext .xz
Thomas Ward
  • 2,600
  • 2
  • 18
  • 31
Divyani Singh
  • 294
  • 2
  • 5
  • 1
    WOW I must be an idiot to not read that in the manpages. Looks like it works, though I put this into the /etc/logrotate.d/rsyslog where `/var/log/syslog` is defined. I wasn't precise about where it was, but that's where it sits in this Debian install. Thank you! – Thomas Ward Aug 04 '20 at 21:35