• Willkommen im Linux Club - dem deutschsprachigen Supportforum für GNU/Linux. Registriere dich kostenlos, um alle Inhalte zu sehen und Fragen zu stellen.

Logrotate rotiert nicht

Hallo,

ich habe ein Problem mit logrotate.
Ich möchte Apache-Logdateien auf einem Webserver rotieren lassen.

Ich habe folgende logrotate-Konfigurationsdatei angelegt:
Code:
/srv/www/vhosts/meine_subdomain/logs/access_log {      
        weekly                                     
        rotate 4                                   
        missingok                                  
        sharedscripts                              
        postrotate                                 
                /etc/init.d/apache2 reload         
        endscript                                  
}
In /etc/logrotate.con habe ich sie eingebunden:
Code:
include /srv/www/vhosts/conf/logrotate
In /etc/cron.weekly/ ist logrotate vorhanden.

Wenn ich logrotate im Debug-Modus laufen lasse oder sogar manuell die Rotation durchführen lasse, wird alles korrekt rotiert.

Das Problem:
Logrotate rotiert die Logdateien einfach nicht automatisch...

Kann mir jemand sagen woran das liegen könnte?
Muss ich cron noch weiter konfigurieren?

Viele Grüße und Danke im vorraus,
Nokobon
 
Hallo.

Hilft es, wenn man dir einen standardeintrag zeigt, der funktioniert? Ich hab hier einen aus /etc/logrotate.d/apache2
Code:
/var/log/apache2/access_log {
    compress
    dateext
    maxage 365
    rotate 99
    size=+4096k
    notifempty
    missingok
    create 644 root root
    postrotate
     /etc/init.d/apache2 reload
    endscript
}

Meldungen, warum es nicht klappt gibts keine?

Ahso wenn ich mir das so ansehe, dann ist die include angabe glaube ich für ein Verzeichnis schon angegeben.
Die Information müsste dann glaube ich in ein configfile?

eventuell:
touch /etc//etc/logrotate.d/deinedomain
Dann in dieses file die Information einbinden?

Das müstte dann mit all den anderen configfiles geladen werden, wie beispielsweise das von apache2 oder mysql usw.?

Ist die include angabe ein Verzeichnis? Vielleicht auch nicht verkehrt es gleich in diese Datei hineinzuschreiben?
Code:
/etc/logrotate.d/apache2
Weiss aber nicht genau, ob es dann eventuell von einem RPM überschrieben werden könnte bei einer Aktualisierung.

Aus der manpage zu "include":
include file_or_directory
Reads the file given as an argument as if it was included inline where the include directive appears. If a directory is given, most of the files in that directory are read in alphabetic order before processing of the including file continues. The only files which are ignored are files which are not regular files (such as directories and named pipes) and files whose names end with one of the taboo extensions, as specified by the tabooext directive. The include directive may not appear inside a log file definition.

Ich glaube dass bei dir hier:
Code:
include /srv/www/vhosts/conf/logrotate
Ein Verzeichnis erwartet wird? Ne Quatsch... entschuldigung! Da steht ja Datei oder Verzeichnis....

Den hier hast du in /etc/crontab ?
Code:
0,15,30,45 * * * *      root    test -x /usr/lib/cron/run-crons && /usr/lib/cron/run-crons >/dev/null 2>&1

Gruß,

R
 
Oben