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.
Question
Options
- Arotatelog
- Bstriplog
- Csyslogd --rotate
- Dlogrotate
- Elogger
How the community answered
(36 responses)- A8% (3)
- B3% (1)
- D86% (31)
- E3% (1)
Why each option
The `logrotate` command is used to automatically rotate, compress, and optionally mail system log files.
`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.
`striplog` is not a standard Linux command for log rotation or compression.
`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`.
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/.
`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
Community Discussion
No community discussion yet for this question.