Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
syslog+logrotate+compress = loosing data
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
ancarpan2
n00b
n00b


Joined: 29 Mar 2004
Posts: 68

PostPosted: Fri Jan 14, 2005 3:07 pm    Post subject: syslog+logrotate+compress = loosing data Reply with quote

I'm using syslog and logrotate with compression and I think I'm missing something because with my configuration I'm able to either loose data or SIGHUP logrotate 10 times each night.

I'm logging al syslog info on 10 files in /var/log ending with ".log".
I'm using this configuration:

Code:

/var/log/*.log {
        compress
        rotate 4
        size=5M
        daily
        olddir /var/log/archive
        missingok
        postrotate
                /bin/killall -HUP syslogd
        endscript
}


This looks ok, but means that logrotate gets 10 HUP, one for each file in /var/log/*.log

If I use the "sharedscripts" option syslog compresses data right after the moving of a single file and not at the end of the whole "set" which means that there's only one HUP, but there's a delay between moving and the signal and I end up loosing data.

Is there some way I can tell logrotate to
1- move all files
2- reopen log files (HUP)
3- compress whatever needs to be compressed

Thanks.
.a.c.
Back to top
View user's profile Send private message
tdemarest
Tux's lil' helper
Tux's lil' helper


Joined: 18 Mar 2003
Posts: 99
Location: California, USA

PostPosted: Tue Feb 08, 2005 3:47 am    Post subject: Reply with quote

Have you tried the delaycompress option?

Code:

       delaycompress
              Postpone compression of the previous log file to the next rotation cycle.  This has only effect when used in combination with compress.   It  can
              be used when some program can not be told to close its logfile and thus might continue writing to the previous log file for some time.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum