2016-07-10 8 views
0

Ich habe versucht, logrotate zu konfigurieren, um das Datum zu halten und die Verlängerung des Stammes gedreht wird:So konfigurieren Logrotate mit dateext und Erweiterung

Mit der aktuellen Konfiguration, die Datei:

/var/www/redmine/log/production.log

Ist logrotated in:

/var/www/re dmine/log/production.-20160710log

Ich erwartete:

/var/www/redmine/log/production-20160710.log

Bitte siehe unten einen Auszug vof die logrotate Konfigurationsdatei:

Katze /etc/logrotate.d/redmine

rotate 4 
    weekly 
    missingok 
    notifempty 
    compress 
    delaycompress 
    sharedscripts 
    dateext 

    /var/www/redmine/log/production.log 
    { 
      create 755 www-data www-data 
      extension log 
    } 

Antwort

4

Ich habe es!

Nur hinzugefügt "dateformat% Y-% m-% d." Einschließlich eines "." im Format

rotate 4 
weekly 
missingok 
notifempty 
compress 
delaycompress 
sharedscripts 
dateext 
dateformat %Y-%m-%d. 

/var/www/redmine/log/production.log 
{ 
     create 755 www-data www-data 
     extension log 
}