Better (stable) names for rotated logfiles
Joshua Judson Rosen
jrosen at harvestai.com
Tue Mar 20 19:27:22 UTC 2012
I'm working on a patch to make the busybox syslogd's log-rotation
facility produce rotated logfiles with stable filename, i.e.: rather
than appending a series-number to the filename and rotating the numbers,
I append a *timestamp* to the name--and the name of a rotated logfile
then never needs to change.
Is there any interest in having this upstream in busybox? Do other
people want to do this?
Alternately, is this somehow a bad idea (what should I be doing instead?).
The idea here is basically to eliminate the race-condition that exists
when trying to, for example, copy the logfiles off of a system: syslogd
may decide to rotate, and hence rename all of the logfiles, while I'm in
the middle of downloading the series onto another machine, and I may end
up missing a file somewhere in the middle.
It's mostly a straightforward change, and easy to #ifdef out--the only
`funny' part is that I can't just let the oldest logfile in the series
`get rename()'d off the end', but rather need to glob and count the results.
--
"Don't be afraid to ask (λf.((λx.xx) (λr.f(rr))))."
More information about the busybox
mailing list