logrotate is the utility included in most Linux distributions specifically designed to manage the automatic rotation and compression of log files. It allows removal of old log files, compresses rotated logs, and can be configured to mail the rotated logs to a specified address, as documented in its configuration file (typically /etc/logrotate.conf) and man page.
Community Discussion