[syslog-ng] Logrotate Questions And Solicitation For Ideas...

JP Senior JPSenior at Veer.com
Thu Jul 20 21:18:03 CEST 2006


Vadim, in syslog_ng.conf:

destination autorotatedlogs {
	file(
		"/var/logs/$HOST/$HOST.$DAY.log"
		remove_if_older(2591000)
	);
};

This should create 'server01-.04.log', and delete that file if it's
older than 30 days (minus 1000 seconds for possible skewing), and start
fresh anew the next time the 4th day of the month rolls by.

This should set you up with a 30 day log rotation.

-JP Senior
jpsenior at veer.com
403-313-5514


-----Original Message-----
From: syslog-ng-bounces at lists.balabit.hu
[mailto:syslog-ng-bounces at lists.balabit.hu] On Behalf Of Vadim Pushkin
Sent: Thursday, July 20, 2006 12:53 PM
To: syslog-ng at lists.balabit.hu
Subject: Re: [syslog-ng] Logrotate Questions And Solicitation For
Ideas...

Hi Nate;

I'd love to use logrotate, but as you can see from my original post, my
logs are in a bunch of dirs, mostly created on the fly as new stuff
comes in.  
How do I configure logrotate.conf for this?

Thank you,

.vp

>From: Nate Campi <nate at campin.net>

>On Wed, Jul 19, 2006 at 10:07:39PM -0400, Valdis.Kletnieks at vt.edu
wrote:
> > On Wed, 19 Jul 2006 22:26:15 -0000, Vadim Pushkin said:
> > > Again, I am looking to rotate my logs, not delete them.  Ideally,
>something
> > > like retaining *.logs.1 *.logs.2, etc.
> >
> > Oh my.  They *have* to be called logs, logs.1, logs.2, logs.3... 
>logs.30? :)
>
>Go with what Valdis recommends. If you really have to rotate them, use 
>logrotate.
>--
>Nate


_______________________________________________
syslog-ng maillist  -  syslog-ng at lists.balabit.hu
https://lists.balabit.hu/mailman/listinfo/syslog-ng
Frequently asked questions at http://www.campin.net/syslog-ng/faq.html



More information about the syslog-ng mailing list