Disable ads (and more) with a premium pass for a one time $4.99 payment
The command utilized to configure log rotation in a Linux system is logrotate. This tool is specifically designed to manage the automatic rotation and compression of log files, which helps to keep log file sizes manageable and ensures that older logs do not consume excessive disk space.
Logrotate operates based on configuration files, typically found in the /etc/logrotate.conf or in the /etc/logrotate.d directory, where individual applications can define their specific log rotation policies. These configurations dictate how often logs should be rotated, how many rotations to keep, whether to compress old logs, and any post-rotation commands that may need to run.
While other options may relate to logging or scheduled tasks, they do not fulfill the specific role of handling log rotation like logrotate does. For instance, logwatch is a monitoring tool that summarizes system logs, crontab is used for scheduling tasks, and rsyslogd is a daemon for logging system messages. Each of these plays a different role in system administration, but only logrotate focuses on the management and rotation of log files.