[Dnsmasq-discuss] Logging

Mogens Melander mogens at fumlersoft.dk
Wed Mar 26 15:30:58 GMT 2008


On Thu, March 13, 2008 00:01, Philippe Faure wrote:
> Hello,
>
> I have found that I left logging enabled, and the dnsmasq.log file is over 500
> Mb.  I was wondering if in the next release there could be a script that would
> automatically, maybe once a week, move the current file to dnsmasq.log.1, and
> so one.  once you have done this for 5 weeks, start to zip the files, or just
> delete them.
>
> Something similar to the what happens to the syslog file and messages files.
>
> Just a suggestion.
>
> Philippe
>

I have the folowing in /etc/logrotate.d/dnsmasq file:

/var/log/dnsmasq.log {
        # create 660 daemon daemon
        notifempty
        daily
        rotate 3
        missingok
        # compress
    postrotate
        # test if dnsmasq is really running
        if test -f /var/run/dnsmasq.pid && \
           pgrep -o dnsmasq &>/dev/null
        then
           kill -SIGUSR2 `cat /var/run/dnsmasq.pid`
        fi
    endscript
}

-- 
Later

Mogens Melander
+45 40 85 71 38
+66 870 133 224



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.




More information about the Dnsmasq-discuss mailing list