Rotate and compress log files with Logrotate
If we run many services on our server, comprehensive and regular scanning of our log files becomes difficult. A useful solution is the logrotate command, which automatically rotates log files generated by various programs, compresses older ones and deletes older ones than the specified time, as well as the ability to send email notifications. With the use of the program, we no longer have to worry about the log files being buried after a few days or weeks of absence, because they are waiting in an orderly state for us to review them. In this description we will get acquainted with the general use of the Logrotate program.