nerdexam
CompTIA

LX0-104 · Question #36

Which of the following commands is used to rotate, compress, and mail system logs?

The correct answer is D. logrotate. The logrotate command is used to automatically rotate, compress, and optionally mail system log files.

Administrative Tasks

Question

Which of the following commands is used to rotate, compress, and mail system logs?

Options

  • Arotatelog
  • Bstriplog
  • Csyslogd --rotate
  • Dlogrotate
  • Elogger

How the community answered

(36 responses)
  • A
    8% (3)
  • B
    3% (1)
  • D
    86% (31)
  • E
    3% (1)

Why each option

The `logrotate` command is used to automatically rotate, compress, and optionally mail system log files.

Arotatelog

`rotatelog` is a specific utility often used by web servers like Apache to rotate their own access and error logs, not a general system log rotator.

Bstriplog

`striplog` is not a standard Linux command for log rotation or compression.

Csyslogd --rotate

`syslogd` is the system logging daemon that collects logs, but it does not have a `--rotate` option for managing the rotation of log files itself; it relies on tools like `logrotate`.

DlogrotateCorrect

The `logrotate` utility is a system administration program that automates the management of log files. It can rotate logs (rename and start new ones), compress old logs to save space, remove very old logs, and even mail logs to an administrator, all based on configuration defined in /etc/logrotate.conf and /etc/logrotate.d/.

Elogger

`logger` is a command-line tool used to send messages to the system syslog daemon, not for rotating or compressing existing log files.

Concept tested: System log management

Source: https://man7.org/linux/man-pages/man8/logrotate.8.html

Topics

#logrotate#log management#system logs#log compression

Community Discussion

No community discussion yet for this question.

Full LX0-104 Practice