Logrotate in solaris

Aus Howtos und Gedankenstuetzen

Wechseln zu: Navigation, Suche

logrotate config file is /etc/logadm.conf

To add a new log file to logrotate use the command logadm.


Example for squid logrotate:


logadm -w /opt/csw/var/log/access.log -C 9999 -p 1w -t '/opt/csw/var/log/$basename.$n.%Y_%m_%d' -z 0

-w = add a new logfile to logadm.conf

-C = count; Delete the oldest versions until there are not more than count files left. Standard 8 files

-p = period; Rotate a log file after the specified time period. 1w = one week

-t = template; numbered, and datestamped

-z = 0 means, that no files will be left unzipped


logrotate debug = logadm -vn


run logrotate now = logadm