Log rotation

k1l0b1t

Verified User
Joined
May 10, 2020
Messages
525
Location
Belgium
I have one of my rpi's pull yesterdays website acces logs off the Directadmin box for processing with a log analyzer (some custom script), Now I've noticed that it does log rotation a bit weird on the end of the month:
I'd expect that yesterdays logs (2021-01-31) are still at Jan-2021.tar.gz, yet they are at Feb-2021.tar.gz.1. Also the Feb-2021.tar.gz lastmod date is at 4AM (instead of being at 00:10 or something)

Is this a bug, or "expected" behaviour?

I've modified my script to work now, but it somehow feels odd.

Perhaps having the rotated log files not have the month name in them makes things more simple? (so you have just log.tar.gz, log.tar.gz.1 and so on) This way you know that yesterdays logs are at log.tar.gz and the logs of the day before yesterday are in log.tar.gz.1, no matter which month we are in.
 
Back
Top