|
How To -
Solaris
|
|
Written by Christian Foronda
|
|
Monday, 15 March 2010 13:42 |
|
logadm is a general log rotation tool that is suitable for running from cron
Location:
# /usr/sbin/logadm
Configuration:
# /etc/logadm.conf
Syntax:
# /usr/sbin/logadm <space> options
Check For Errors And Activate Changes:
# /usr/sbin/logadm -V
Samples:
# cat /etc/logadm.conf
/var/adm/sshdlog -C 7 -P 'Sat Jan 21 08:10:00 2006' -a 'pkill sshd2'
Options:
-C -- count; Delete the oldest versions until there are not more than count files left. This option specifies the maximum number of log files to keep. If exceeded, the oldest file will be deleted to keep the total number at specified value
-P -- period; Rotate a log file after the specified time period (period) .This option is used to specify a timestamp for the particular log last rotation. Specify period as a number followed by d for days, w for weeks, m for months (really 30 days) or y for years. There are also two special values for period: now and never. -p now forces log rotation. -p never forces no log rotation.
-a -- This option is used to specify a post command that is run once after all logs have been rotated. The command can send HUP signal to a daemon or restart it. It also can be used to compress the rotated log with non standard compressor (-z option can be used for standard compressor) and or send message to sysadmin
-s -- size Rotate the log file only if its size is greater than or equal to size. Specify size as a number followed by the letter b for bytes, k for kilobytes, m for megabytes, or g for gigabytes.
|
|
Last Updated on Monday, 15 March 2010 14:10 |