[Nix-dev] logrotate

Lluís Batlle i Rossell viric at viric.name
Wed Feb 15 09:07:24 CET 2012


On Wed, Feb 15, 2012 at 07:46:47AM +0100, Mathijs Kwik wrote:
> I enabled services.logrotate, but I found it comes with an empty config.
> Can someone please share his config? I'm lazy :)
> 
> Perhaps we can come up with a nice default config that's suitable for
> most people?

Ehm. I'm guilty I think. :)

Here is mine, for a /var/log on tmpfs of 32MB:

    logrotate = {
      enable = true;
      config = ''
        compress

        /var/log/messages /var/log/warn /var/log/mail {
          rotate 3
          size 500k
          sharedscripts
          postrotate
            source /etc/bashrc
            kill -HUP `cat /var/run/syslogd.pid`
          endscript
        }

        /var/log/httpd/* {
          rotate 3
          size 500k
          sharedscripts
          postrotate
            source /etc/bashrc
            kill -HUP `cat /var/run/httpd/httpd.pid`
          endscript
        }
      '';
    };

If that's fine for a default config, it's easy to commit.

Regards,
Lluís


More information about the nix-dev mailing list