From: Chris <cpo...@em...> - 2016-09-25 12:46:52
|
On Sun, 2016-09-25 at 11:32 +0200, Carlos E. R. wrote: > On 2016-09-25 04:08, Chris wrote: > > > > On Sun, 2016-09-25 at 03:24 +0200, Carlos E. R. wrote: > > > > > I can just have procmail log to syslog also. I was attempting to > > use > > webmins logrotate setup yesterday but couldn't get it to where it > > would > > kill the fetchmail process, rotate and recreate the log then > > restart > > fetchmail. > If you use "logrotate" it is quite simple, actually. It is a > directory > "/etc/logrotate.d" with config files. Take the one for apache, it > contains entries for each file it handles: > > var/log/apache2/access_log { > compress > dateext > maxage 365 > rotate 99 > size=+4096k > notifempty > missingok > create 644 root root > postrotate > /usr/bin/systemctl reload apache2.service > endscript > } > > The "postrotate" is what it does with the process. I see one file for > fetchmail, too: > > var/log/fetchmail { > compress > dateext > maxage 365 > rotate 99 > size=+1024k > notifempty > missingok > copytruncate > create 0600 fetchmail root > } > > It doesn't kill the service. Instead it copies and trunctates the > log. > > This is in openSUSE, other distros may vary. > Thanks for that Carlos, I'll put that in my /etc/logrotate.d folder and see if it works. -- Chris KeyID 0xE372A7DA98E6705C 31.11972; -97.90167 (Elev. 1092 ft) 07:45:05 up 1 day, 9:39, 1 user, load average: 1.75, 1.61, 1.03 Ubuntu 16.04.1 LTS, kernel 4.4.0-38-generic #57-Ubuntu SMP Tue Sep 6 15:42:33 UTC 2016 |