LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   problem with logrotate (https://www.linuxquestions.org/questions/linux-newbie-8/problem-with-logrotate-336720/)

tflavell 06-24-2005 06:44 AM

problem with logrotate
 
Hi

Very new newbie here so be gentle with me !

I have run logrotate from the desktop and got the following message

error: etc/logrotate.conf:25 duplicate log entry for /var/log/wtmp and the log files were not rotated.
When I commented out the wtmp rotation script from the logrotate.conf file and tried again, the logrotate seemed to work ok.

Any ideas what may be causing this and how to rectify it ?

Thanks, Tony

makuyl 06-25-2005 06:57 AM

Post /etc/logrotate.conf
The wtmp part should look something like:
Code:

/var/log/wtmp {
    missingok
    monthly
    create 0660 root utmp
    rotate 1
}


tflavell 06-27-2005 03:17 AM

I tried setting up the WTMP script exactly as you suggested but I'm still getting the same message. Any ideas ?

makuyl 06-27-2005 11:59 AM

Do you have an entry for wtmp in /etc/logrotate.d/ ?
Post logrotate.conf or have a look if you have /var/log/* there.

tflavell 07-01-2005 01:47 PM

Hi

Here is the wtmp entry in /etc/logrotate.d

/var/log/wtmp {
compress
dateext
maxage 365
rotate 99
size=+400k
notifempty
missingok
copytruncate
}


and here is my logrotate.conf

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

# rotate log daily
weekly

# keep 2 weeks worth of backlogs
rotate 2

# 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

# 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

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

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

makuyl 07-01-2005 03:22 PM

Well, you rotate wtmp from both the entry in /etc/logrotate.d and from logrotate.conf, hence duplicate entries. Just comment out the part in logrotate.conf.

tflavell 07-04-2005 03:32 AM

That's done it. Many thanks for all your help.


All times are GMT -5. The time now is 03:41 PM.