public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] logrotate desn't create new empty files
@ 2007-08-03 11:16 Jakob
  2007-08-03 14:41 ` Dale
  2007-08-03 14:47 ` Matthias Guede
  0 siblings, 2 replies; 7+ messages in thread
From: Jakob @ 2007-08-03 11:16 UTC (permalink / raw
  To: gentoo-user

Hi all,

I'm running logrotate on my homeserver and the logs are rotated
correctly but after rotating it should create new empty log files and
that doesnt work.

here are my confs:
/etc/logrotate.conf:
# $Header: /var/cvsroot/gentoo-x86/app-admin/logrotate/files/logrotate.conf,v
1.2 2004/07/18 01:58:24 dragonheart Exp $
#
# Logrotate default configuration file for Gentoo Linux
#
# See "man logrotate" for details

# rotate log files weekly
weekly
#daily

# keep 4 weeks worth of backlogs
rotate 10

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

# uncomment this if you want your log files compressed
compress

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

notifempty
nomail
noolddir

# no packages own lastlog or 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.

 and /etc/logrotate.d/syslog-ng:
# $Header: /var/cvsroot/gentoo-x86/app-admin/syslog-ng/files/syslog-ng.logrotate,v
1.2 2004/07/18 02:25:02 dragonheart Exp $
#
# Syslog-ng logrotate snippet for Gentoo Linux
# contributed by Michael Sterrett
#

/var/log/messages {
  dateext
  olddir /var/log/
  copy
  create 0600 root root
  size 5000k
  sharedscripts
  postrotate
        /etc/init.d/syslog-ng reload > /dev/null 2>&1 || true
  endscript
}

I thought create will do this but it doesn't work and my logs getting
bigger and bigger.
What did I do wron?

Regards

Jakob
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-user] logrotate desn't create new empty files
  2007-08-03 11:16 [gentoo-user] logrotate desn't create new empty files Jakob
@ 2007-08-03 14:41 ` Dale
  2007-08-03 14:47 ` Matthias Guede
  1 sibling, 0 replies; 7+ messages in thread
From: Dale @ 2007-08-03 14:41 UTC (permalink / raw
  To: gentoo-user

Jakob wrote:
> Hi all,
>
> I'm running logrotate on my homeserver and the logs are rotated
> correctly but after rotating it should create new empty log files and
> that doesnt work.
>
> here are my confs:
> /etc/logrotate.conf:
> # $Header: /var/cvsroot/gentoo-x86/app-admin/logrotate/files/logrotate.conf,v
> 1.2 2004/07/18 01:58:24 dragonheart Exp $
> #
> # Logrotate default configuration file for Gentoo Linux
> #
> # See "man logrotate" for details
>
> # rotate log files weekly
> weekly
> #daily
>
> # keep 4 weeks worth of backlogs
> rotate 10
>
> # create new (empty) log files after rotating old ones
> create
>
> # uncomment this if you want your log files compressed
> compress
>
> # packages can drop log rotation information into this directory
> include /etc/logrotate.d
>
> notifempty
> nomail
> noolddir
>
> # no packages own lastlog or 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.
>
>  and /etc/logrotate.d/syslog-ng:
> # $Header: /var/cvsroot/gentoo-x86/app-admin/syslog-ng/files/syslog-ng.logrotate,v
> 1.2 2004/07/18 02:25:02 dragonheart Exp $
> #
> # Syslog-ng logrotate snippet for Gentoo Linux
> # contributed by Michael Sterrett
> #
>
> /var/log/messages {
>   dateext
>   olddir /var/log/
>   copy
>   create 0600 root root
>   size 5000k
>   sharedscripts
>   postrotate
>         /etc/init.d/syslog-ng reload > /dev/null 2>&1 || true
>   endscript
> }
>
> I thought create will do this but it doesn't work and my logs getting
> bigger and bigger.
> What did I do wron?
>
> Regards
>
> Jakob
>   

The command touch should work.  Not sure on the permissions though.

Dale

:-)  :-)
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-user] logrotate desn't create new empty files
  2007-08-03 11:16 [gentoo-user] logrotate desn't create new empty files Jakob
  2007-08-03 14:41 ` Dale
@ 2007-08-03 14:47 ` Matthias Guede
  2007-08-04  8:29   ` Jakob
  1 sibling, 1 reply; 7+ messages in thread
From: Matthias Guede @ 2007-08-03 14:47 UTC (permalink / raw
  To: gentoo-user

2007/8/3, Jakob <jak.gentoo@googlemail.com>:
> Hi all,
>
> I'm running logrotate on my homeserver and the logs are rotated
> correctly but after rotating it should create new empty log files and
> that doesnt work.
>
> here are my confs:
> /etc/logrotate.conf:
> # $Header: /var/cvsroot/gentoo-x86/app-admin/logrotate/files/logrotate.conf,v
> 1.2 2004/07/18 01:58:24 dragonheart Exp $
> #
> # Logrotate default configuration file for Gentoo Linux
> #
> # See "man logrotate" for details
>
> # rotate log files weekly
> weekly
> #daily
>
> # keep 4 weeks worth of backlogs
> rotate 10
>
> # create new (empty) log files after rotating old ones
> create
>
> # uncomment this if you want your log files compressed
> compress
>
> # packages can drop log rotation information into this directory
> include /etc/logrotate.d
>
> notifempty
> nomail
> noolddir
>
> # no packages own lastlog or 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.
>
>  and /etc/logrotate.d/syslog-ng:
> # $Header: /var/cvsroot/gentoo-x86/app-admin/syslog-ng/files/syslog-ng.logrotate,v
> 1.2 2004/07/18 02:25:02 dragonheart Exp $
> #
> # Syslog-ng logrotate snippet for Gentoo Linux
> # contributed by Michael Sterrett
> #
>
> /var/log/messages {
>   dateext
>   olddir /var/log/
>   copy
>   create 0600 root root
>   size 5000k
>   sharedscripts
>   postrotate
>         /etc/init.d/syslog-ng reload > /dev/null 2>&1 || true
>   endscript
> }
>
> I thought create will do this but it doesn't work and my logs getting
> bigger and bigger.
> What did I do wron?
>
> Regards
>
> Jakob
> --
> gentoo-user@gentoo.org mailing list
>
>

from LOGROTATE(8):

Here  is  more information on the directives which may be included in a
logrotate configuration file:

[...]

copy   Make  a  copy  of the log file, but don't change the original at
              all.  This option can be used, for instance, to make a  snapshot
              of  the  current  log  file, or when some other utility needs to
              truncate or pare the file.  When this option is used, the create
              option  will have no effect, as the old log file stays in place.
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-user] logrotate desn't create new empty files
  2007-08-03 14:47 ` Matthias Guede
@ 2007-08-04  8:29   ` Jakob
  2007-08-04 10:09     ` Mick
  0 siblings, 1 reply; 7+ messages in thread
From: Jakob @ 2007-08-04  8:29 UTC (permalink / raw
  To: gentoo-user

> from LOGROTATE(8):
>
> Here  is  more information on the directives which may be included in a
> logrotate configuration file:
>
> [...]
>
> copy   Make  a  copy  of the log file, but don't change the original at
>               all.  This option can be used, for instance, to make a  snapshot
>               of  the  current  log  file, or when some other utility needs to
>               truncate or pare the file.  When this option is used, the create
>               option  will have no effect, as the old log file stays in place.
> --
> gentoo-user@gentoo.org mailing list
>

Thanks for that, I deleated copy, but it seams that the problem stays :-(
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-user] logrotate desn't create new empty files
  2007-08-04  8:29   ` Jakob
@ 2007-08-04 10:09     ` Mick
  2007-08-05  7:36       ` Jakob
  0 siblings, 1 reply; 7+ messages in thread
From: Mick @ 2007-08-04 10:09 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1534 bytes --]

On Saturday 04 August 2007 09:29, Jakob wrote:
> > from LOGROTATE(8):
> >
> > Here  is  more information on the directives which may be included in a
> > logrotate configuration file:
> >
> > [...]
> >
> > copy   Make  a  copy  of the log file, but don't change the original at
> >               all.  This option can be used, for instance, to make a 
> > snapshot of  the  current  log  file, or when some other utility needs to
> > truncate or pare the file.  When this option is used, the create option 
> > will have no effect, as the old log file stays in place. --
> > gentoo-user@gentoo.org mailing list
>
> Thanks for that, I deleated copy, but it seams that the problem stays :-(

Look for a dead.letter file in /root which may contain any errors of the 
logrotate script.  In my system there is /etc/logrotate.d/syslog-ng which 
contains:
===================================
# 
$Header: /var/cvsroot/gentoo-x86/app-admin/syslog-ng/files/syslog-ng.logrotate,v 
1.2 2004/07/18 02:25:02 dragonheart Exp $
#
# Syslog-ng logrotate snippet for Gentoo Linux
# contributed by Michael Sterrett
#

/var/log/messages {
    sharedscripts
    postrotate
        /etc/init.d/syslog-ng reload > /dev/null 2>&1 || true
    endscript
}
===================================

It seems to rotate the messages log file fine and create compressed backups 
within /var/log.  If you have both scripts then there may be a conflict which 
would probably be captured in dead.letter.

HTH.
-- 
Regards,
Mick

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-user] logrotate desn't create new empty files
  2007-08-04 10:09     ` Mick
@ 2007-08-05  7:36       ` Jakob
  2007-08-05  9:04         ` Mick
  0 siblings, 1 reply; 7+ messages in thread
From: Jakob @ 2007-08-05  7:36 UTC (permalink / raw
  To: gentoo-user

> Look for a dead.letter file in /root which may contain any errors of the
> logrotate script.  In my system there is /etc/logrotate.d/syslog-ng which
> contains:
> ===================================
> #
> $Header: /var/cvsroot/gentoo-x86/app-admin/syslog-ng/files/syslog-ng.logrotate,v
> 1.2 2004/07/18 02:25:02 dragonheart Exp $
> #
> # Syslog-ng logrotate snippet for Gentoo Linux
> # contributed by Michael Sterrett
> #
>
> /var/log/messages {
>     sharedscripts
>     postrotate
>         /etc/init.d/syslog-ng reload > /dev/null 2>&1 || true
>     endscript
> }
> ===================================
>
> It seems to rotate the messages log file fine and create compressed backups
> within /var/log.  If you have both scripts then there may be a conflict which
> would probably be captured in dead.letter.
>
> HTH.
> --
> Regards,
> Mick
>
Thanks for that hint, but there was nothing about logrotate in dead.letter.
logrotate itself works fine for me but I want the messages file erased
after rotating and start with a new file and that doesn't work.
any more ideas?

Regards

Jakob
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-user] logrotate desn't create new empty files
  2007-08-05  7:36       ` Jakob
@ 2007-08-05  9:04         ` Mick
  0 siblings, 0 replies; 7+ messages in thread
From: Mick @ 2007-08-05  9:04 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1265 bytes --]

On Sunday 05 August 2007 08:36, Jakob wrote:

> Thanks for that hint, but there was nothing about logrotate in dead.letter.
> logrotate itself works fine for me but I want the messages file erased
> after rotating and start with a new file and that doesn't work.
> any more ideas?

I am not sure I understand "that doesn't work":

It does not rotate the message log file at all?
It rotates it but does not create a new empty message log file after rotation?  

Anyway, look at your script in /etc/logrotate.d/syslog-ng:

Your entry for olddir is redundant.  The rotated logs will remain in 
the /var/log directory anyway.  Use olddir if you want to place them 
somewhere else; e.g. /var/log/old_messages, but make sure that the new 
directory old_messages is owned by root:root.

As already commented by Matthias Guede, the entry "copy" is not appropriate if 
you want to actually rotate the log file as opposed to just copy it.

The entry "create 0600 root root" is also redundant as you already specify 
create as a default option in your /etc/logrotate.conf.  (This may mess 
things up.)

Finally, the size at 5M is relatively large so rotation is not going to take 
place that often unless you force it.

HTH.
-- 
Regards,
Mick

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-08-05  9:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-03 11:16 [gentoo-user] logrotate desn't create new empty files Jakob
2007-08-03 14:41 ` Dale
2007-08-03 14:47 ` Matthias Guede
2007-08-04  8:29   ` Jakob
2007-08-04 10:09     ` Mick
2007-08-05  7:36       ` Jakob
2007-08-05  9:04         ` Mick

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox