PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : logrotate Verständnisfrage



Manfred Werner
05.02.07, 14:17
Hallo Forum,

Wer kann mir mal helfen,
ich möchte, dass über logrotate das logfile /var/log/mail
einmal in der Woche geleert wird. Die logrotate.conf wurde bei der Installation eingerichtet und sieht so aus.

# 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

# uncomment these to switch compression to bzip2
compresscmd /usr/bin/bzip2
uncompresscmd /usr/bin/bunzip2

# former versions had to have the compresscommand set accordingly
#compressext .bz2

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

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

# system-specific logs may be also be configured here.

Da ich mit der Man-Page nicht so recht klar komme, poste ich mal.;)
Wer kann mir sagen wie der Eintrag für das maillog aussehen müsste

Manfred

rudi_m
05.02.07, 14:27
include /etc/logrotate.d
In diesem Verzeichnis liegen die speziellen configs fuer verschiedene logfiles

Manfred Werner
05.02.07, 21:06
Hallole,

wäre dieser Eintrag für die /var/log/messages und die Maillogs ok ??


# 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
/var/log/warn /var/log/messages /var/log/allmessages /var/log/localmessages /var/log/firewall {
compress
dateext
maxage 365
rotate 99
missingok
notifempty
size +4096k
create 640 root root
sharedscripts
postrotate
/etc/init.d/syslog reload
endscript
}

/var/log/mail /var/log/mail.info /var/log/mail.warn /var/log/mail.err {
compress
dateext
maxage 365
rotate 99
missingok
notifempty
size +4096k
create 640 root root
sharedscripts
postrotate
/etc/init.d/syslog reload
endscript
}


# uncomment these to switch compression to bzip2
compresscmd /usr/bin/bzip2
uncompresscmd /usr/bin/bunzip2

# former versions had to have the compresscommand set accordingly
#compressext .bz2

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

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

# system-specific logs may be also be configured here.

Ich habe den Inhalt von /etc/logrotate.d/syslog übernommen.
In diesem Fall habe ich mich noch nicht so genau mit den einzelnen Parametern auseinandergesetzt. Bitten nicht schmimpfen :ugly:

Manfred

Fly
06.02.07, 08:14
Du kannst logrotate mit Schalter d testen :)



logrotate -d <configfile>


Siehe man logrotate