Better (stable) names for rotated logfiles

ralda at ralda at
Tue Mar 20 19:55:34 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.

IMHO it is a great idea. I would like it.

> 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)


More information about the busybox mailing list