logrotate from Scratch: Rotate, Compress, Prune, Repeat
What logrotate actually does, what runs it and when, where its configuration and state live, how to write and test a rule for your own application, and the handful of sharp edges that stay hidden until it runs at a time you did not plan.