[rsyslog] central logserver log rotation

Jan-Frode Myklebust janfrode at tanso.net
Fri Mar 28 08:51:22 CET 2008


On 2008-03-27, Rainer Gerhards <rgerhards at hq.adiscon.com> wrote:
> the typical solution seems to be to include a date-specific part in the
> filename:
>
> /var/log/rsyslog/%$YEAR%/%$MONTH%/%$DAY%/%HOSTNAME%
>
> And clean up the directories every now and then...

/etc/rsyslog.conf:

	#####################################################
	# Log everything to a per host daily logfile        #
	#####################################################
	$template DailyPerHostLogs,"/var/log/syslog/%$YEAR%/%$MONTH%/%$DAY%/%HOSTNAME%/messages.log"
	*.* -?DailyPerHostLogs

/etc/cron.hourly/syslog-bzip2:

	find /var/log/syslog/2008 -type f -mtime +1  -name "*.log" -exec bzip2 '{}' \;



  -jf



More information about the rsyslog mailing list