View previous topic :: View next topic |
Author |
Message |
ancarpan2 n00b
Joined: 29 Mar 2004 Posts: 68
|
Posted: Fri Jan 14, 2005 3:07 pm Post subject: syslog+logrotate+compress = loosing data |
|
|
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 |
|
|
tdemarest Tux's lil' helper
Joined: 18 Mar 2003 Posts: 99 Location: California, USA
|
Posted: Tue Feb 08, 2005 3:47 am Post subject: |
|
|
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 |
|
|
|