If you run busy Solaris servers, you may have realized that the logfiles in /var/log and /var/adm can grow pretty large. These files are periodically rotated with the Solaris logadm utility, but they are not compress with the default logadm configuration. To change this behavior, you can add use the “-z 0” option to compress logfiles after they are rotated:
$ logadm -w /var/log/maillog -C 8 -P 'Wed Dec 21 19:56:59 2005' -a 'kill -HUP
cat /var/run/syslog.pid' -s 1m -z 0
Once the “-z” option is added, you can check the configuration by running logadm with the “-V” option:
$ logadm -V | grep maillog
/var/log/maillog -C 8 -P 'Wed Dec 21 19:56:59 2005' -a 'kill -HUP `cat
/var/run/syslog.pid`' -s 1m -z 0
If you would like to compress existing files and force a rotation, you can invoke logadm with the “-p now” option:
$ logadm -p now /var/log/maillog
Hopefully this will save folks some disk space (not that it’s really required with the size of today’s disks).