From: Bonno B. <b.b...@ti...> - 2008-05-08 13:26:57
|
Hi, > copytruncate [...] > which works without a postrotate section... Aha, that's the magic trick in this case. Would be nice though if there were a way to tell openvpn that the logfile has been rotated and that it needs to open a new logfile with having to restart the whole service. the copytruncate trick might loose a few lines as stated in the man pages for logrotate. Now all I need it to get rid of the bad address lines as there are 447815 of those lines in almost two weeks. That's a nice chunk of the logfile. :-( See my other mail to which I'll do a reply. Met vriendelijke groet, Bonno Bloksma hoofd systeembeheer tio hogeschool hospitality en toerisme begijnenhof 8-12 / 5611 el eindhoven t 040 296 28 28 / f 040 237 35 20 b.b...@ti... / www.tio.nl ----- Original Message ----- From: Jan Just Keijser To: Bonno Bloksma Cc: ope...@li... Sent: Thursday, May 08, 2008 2:20 PM Subject: Re: [Openvpn-users] logrotate Hi Bonno, Bonno Bloksma wrote: > Hi, > > Using Openvpn 2.0.9-4etch1_i386 on Debian eth 4.0r3 > I want to keep my OpenVPN log messages seperate and don't have them in > the syslog. But... I do need to have to rotate the log at least once a > week. > > 1) > Currently I log to /etc/openvpn/openvpn.log, should I change that to > /var/log/openvpn.log? > Would changing the line: > log-append openvpn.log > to > log-append /var/log/openvpn.log > be enough? The documentation does not state whether a full path is > possible or just a filename. yes this is possible > > 2) > How do I add the openvpn.log file to the weekly logrotation on a > Debian etch systeem? > Probably something with /etc/logrotate.conf or a file in > /etc/logrotate.d/ but.. I'm almost there but not quite. :-) > > It seems I might have to put an openvpn file in the /etc/logrotate.d/ > directory with something like: > /var/log/openvpn.log { > weekly > rotate 4 > compress > missingok > postrotate > pkill -SIGUSR1 openvpn > /dev/null > endscript > } > But it's the postrotate section I'm not sure about. > I use /var/log/openvpn.log { rotate 5 copytruncate missingok notifempty size 512k } which works without a postrotate section... HTH, JJK |