[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: Better (stable) names for rotated logfiles
From:       Joshua Judson Rosen <jrosen () harvestai ! com>
Date:       2012-03-21 14:52:23
Message-ID: 4F69EB27.3040604 () harvestai ! com
[Download RAW message or body]

On 21/03/12 02:46, Laurent Bercot wrote:
>>> 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.
>>
>> What about a parameter that deletes log files after a specified amount
>> of weeks/days/hours/minutes? That could easily be done by parsing the
>> log file names during a (unsorted) directory walk. Or just delegating
>> the delete of old log files into the background with a simple find
>> command (fork than simply exec /bin/busybox find /var/log ... -delete)
>
>   No, suppressing the oldest archived log file has to be part of the
> rotation procedure. Separating it from the rotation (or separating
> part of the rotation from the logging process) results in the race
> condition that busybox's syslogd was precisely designed to avoid:
> disks may fill up between rotation or suppression of archived log
> files, so new logs may be lost.

You're describing exactly my situation, Laurent: we have a relatively
small amount of storage available in our /var/log filesystem, and
we're always very close to full because we want to preserve as long
a span of logs as possible, so the only thing that makes sense for us
is to use busybox's *filesize-based* rotation and have syslogd manage it.

So of course I haven't done anything to add other features like
time-based rotation :)

I'd really like to get feedback on what sort of changes would be necessary
to make my patch acceptable for inclusion upstream, or suggestions on
how other people work around the problems of series-numbering without
a patch like this.

-- 
"Don't be afraid to ask (λf.((λx.xx) (λr.f(rr))))."
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic