rsyring / zfs-on-root

Scripts to install an Ubuntu system with encrypted ZFS on root
7 stars 1 forks source link

Remove compression on /var/log? #14

Open rsyring opened 4 months ago

rsyring commented 4 months ago

I think the official root document removes compression on /var/log

rsyring commented 1 month ago

Optional: Disable log compression:

As /var/log is already compressed by ZFS, logrotate’s compression is going to burn CPU and disk I/O for (in most cases) very little gain. Also, if you are making snapshots of /var/log, logrotate’s compression will actually waste space, as the uncompressed data will live on in the snapshot. You can edit the files in /etc/logrotate.d by hand to comment out compress, or use this loop (copy-and-paste highly recommended):

for file in /etc/logrotate.d/* ; do if grep -Eq "(^|[^#y])compress" "$file" ; then sed -i -r "s/(^|[^#y])(compress)/\1#\2/" "$file" fi done