Page 1 of 1

Logrotate-Problem

Posted: 2008-03-11 21:45
by dirkv99
Hallo zusammen!

Leider werden meine Logs nicht rotiert.

Code: Select all

usr/sbin/logrotate -v /etc/logrotate.conf
liefert mir bei allen Einträgen nur

Code: Select all

log does not need rotating
Ich bin aber sehr wohl der Meinung, dass sie "Rotating" benötigen! :evil:

Hat jemand eine Idee? Ich hatte erst Crond im Verdacht, dass die Logs nicht
rotiert werden, aber das hat sich damit wohl nicht bestätigt.

Danke für Eure Tipps!

Dirk

Re: Logrotate-Problem

Posted: 2008-03-11 22:03
by Joe User
Wie oft sollen die gewünschten Logs denn laut logrotate.conf rotiert werden und weshalb änderst Du es nicht entsprechend Deiner Anforderungen?

Re: Logrotate-Problem

Posted: 2008-03-11 22:04
by Roger Wilco
dirkv99 wrote:Ich bin aber sehr wohl der Meinung, dass sie "Rotating" benötigen! :evil:
Warum? Und wie sieht deine vollständige Logrotate-Konfiguration aus?

Re: Logrotate-Problem

Posted: 2008-03-11 22:26
by dirkv99
hier meine logrotate.conf:

Code: Select all

# see "man logrotate" for details
# rotate log files weekly
weekly

# keep 4 weeks worth of backlogs
rotate 4

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

# uncomment this if you want your log files compressed
compress

# packages drop log rotation information into this directory
include /etc/logrotate.d

# no packages own wtmp, or btmp -- we'll rotate them here
/var/log/wtmp {
    missingok
    monthly
    create 0664 root utmp
    rotate 1
}

/var/log/btmp {
    missingok
    monthly
    create 0664 root utmp
    rotate 1
}

# system-specific logs may be configured here
die logs sollten eigentlich wöchentlich rotieren - habe ich etwas übersehen?

Re: Logrotate-Problem

Posted: 2008-03-11 22:44
by oxygen
sind die von dir betrachteten Logfiles auch in /etc/logrotate.d konfiguriert? sonst kannst du ja lange warten.

Re: Logrotate-Problem

Posted: 2008-03-11 22:49
by dirkv99
ja, die stehen alle drin - ich kann da nichts unnormales feststellen. ich habe übrigens auch plesk drauf...

Re: Logrotate-Problem

Posted: 2008-03-11 22:58
by Joe User
dirkv99 wrote:ja, die stehen alle drin
Und auch wie gewünscht konfiguriert? Unsere Glaskugeln sind bereits für Ostern bemalt...

Re: Logrotate-Problem

Posted: 2008-03-12 07:01
by dirkv99
ok, da wäre z.b.

Code: Select all

/var/log/mail.info {
  rotate 4
  weekly
  compress
  missingok
  notifempty
  }
aber es tut sich leider nix... muss die log-datei "mail.info" erst 1gb groß werden?
was ist denn die standardgröße bei logrotate, bevor es aktiv wird?

danke! dirk

Re: Logrotate-Problem

Posted: 2008-03-12 23:35
by dirkv99
dieser cronjob existiert allerdings schon seit 3 monaten - das hat mich etwas gewundert.
außerdem war ich der meinung, dass ein manuelles starten von logrotate dies zumindest
bei der erstmaligen ausführung ignoriert...

Re: Logrotate-Problem

Posted: 2008-03-13 00:28
by Roger Wilco
man 8 logrotate wrote: -d Turns on debug mode and implies -v. In debug mode, no changes will be made to the logs or to the logrotate state file.


-f, --force
Tells logrotate to force the rotation, even if it doesn’t think this is necessary. Sometimes this is useful after adding new entries to a logrotate config file, or if old log files have been removed by hand, as the new files will be created, and logging will continue correctly.
Beide Parameter (getrennt voneinander) schon ausprobiert?

Re: Logrotate-Problem

Posted: 2008-03-13 07:06
by dirkv99
danke! rtfm :roll:

Code: Select all

-f, --force
hat geholfen. eine letzte frage: woran erkenne ich, warum logrotate
noch keine notwendigkeit zum rotieren gesehen hatte? an "weekly"
kann es eigentlich nicht liegen - es wurde ja schon einige monate
nicht rotiert...

danke!
dirk