Rotation mit Logrotate und crontab

Alles, was den Apache betrifft, kann hier besprochen werden.

Rotation mit Logrotate und crontab

Postby yoshi80 » 31. January 2007 10:14

Hallo,
ich habe letztens versucht eine Logrotation mit Hilfe von Logrotate durch zu führen.
Ohne jetzt weitere Details auf zu listen (falls jedoch nötig werde ich es nach holen).
Die Rotation müsste funktionieren.
Bei Anwendung wurde ine neue error_lo erstellt und die andere gepackt.
Die neue Error_log bleibt jedoch leer.
Weiss jemand woran eslien könnte?
Gibt es beim Apache eine weitere LOg_Datei die solche Fehler loggt?

gruß Yoshi
yoshi80
 
Posts: 25
Joined: 06. December 2006 12:53

Postby deepsurfer » 31. January 2007 15:21

poste mal deine befehlsstrucktur der Logrotate Definition, sicherlich ist nur irgendwo ein Schreibfehler vorhanden.
chirio Deep
Wie sagte einst der MCP aus Tron auf dem Bildschirm zu schreiben Pflegte
" ... end of communication ... "
User avatar
deepsurfer
AF Moderator
 
Posts: 6440
Joined: 23. November 2004 10:44
Location: Cologne
Operating System: Win-XP / Win7 / Linux -Debian

Postby yoshi80 » 01. February 2007 09:59

In Crontab:
0 0 * * * /.../logrotate.cron



Logrotate.conf:
# rotate log files weekly
weekly

# keep 4 weeks worth of backlogs
rotate 12

# create new (empty) log files after rotating old ones
create

# compress log files
compress
compresscmd /bin/gzip

# additional configuration files
include /.../logrotate.d


Zusätzlich Config für den Apache in - /.../logrotate.d/apache2:

/.../error_log /.../access_log\
/.../mod_jk.log /.../ssl_access_log\
/.../ssl_error_log /...2/ssl_request_log {
size=10M
sharedscripts
missingok
notifempty
postrotate
/usr/bin/kill -HUP `cat /.../httpd.pid 2> /dev/null` 2> /dev/null || true
endscript
}


Das war wohl glaube ich alles.
yoshi80
 
Posts: 25
Joined: 06. December 2006 12:53

Postby Wiedmann » 01. February 2007 10:10

/usr/bin/kill -HUP `cat /.../httpd.pid 2> /dev/null` 2> /dev/null || true

Mit der Zeile stimmt was nicht.
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany


Return to Apache

Who is online

Users browsing this forum: No registered users and 11 guests