Logrotate: usando vários critérios para girar

3

Como posso definir uma política rotativa com base em uma disjunção de critérios de tamanho e frequência. Eu tentei o seguinte:

"/var/log/uwsgi/*/*.log" {
  ...
  size 400M
  daily  rotate 14
  ..
}

No entanto, mesmo quando o logrotate é executado quando o arquivo de log excede 400M de tamanho, nenhuma rotação está sendo feita.

Alguma ideia de como forçar uma rotação em qualquer condição?

    
por Adam Matan 12.11.2014 / 07:56

1 resposta

6

size é incompatível com as configurações baseadas em tempo, por isso, quando você especificou daily depois, ele foi anulado. Tente maxsize . De man logrotate :

maxsize size
      Log files are rotated when they grow bigger than size bytes even
      before the additionally specified time interval (daily,  weekly,
      monthly,  or yearly).  The related size option is similar except
      that it is mutually exclusive with the  time  interval  options,
      and  it  causes  log  files to be rotated without regard for the
      last rotation time.
    
por muru 12.11.2014 / 08:08