Logrotate example. You can of course write a script to automate this.

Logrotate example. When configuration is required for .