[rsyslog] central logserver log rotation

Rainer Gerhards rgerhards at hq.adiscon.com
Fri Mar 28 10:17:44 CET 2008


Hi JF,

thanks, I've made a wiki page out of it:

http://wiki.rsyslog.com/index.php/DailyLogRotation

Rainer

> -----Original Message-----
> From: rsyslog-bounces at lists.adiscon.com [mailto:rsyslog-
> bounces at lists.adiscon.com] On Behalf Of Jan-Frode Myklebust
> Sent: Friday, March 28, 2008 8:51 AM
> To: rsyslog at lists.adiscon.com
> Subject: Re: [rsyslog] central logserver log rotation
> 
> 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%/me
> ssages.log"
> 	*.* -?DailyPerHostLogs
> 
> /etc/cron.hourly/syslog-bzip2:
> 
> 	find /var/log/syslog/2008 -type f -mtime +1  -name "*.log" -exec
> bzip2 '{}' \;
> 
> 
> 
>   -jf
> 
> _______________________________________________
> rsyslog mailing list
> http://lists.adiscon.net/mailman/listinfo/rsyslog



More information about the rsyslog mailing list