CompTIA Linux+ XK0-006 (V8) Practice Question

A systems administrator is tasked with managing the log files for a custom application located at /var/log/app.log. The requirements are to rotate the log file once it reaches 100M, keep the 5 most recent rotated logs, and ensure that the old log files are compressed to save disk space. Which of the following logrotate configurations, placed in a file under /etc/logrotate.d/, will correctly implement these requirements?

  • /var/log/app.log {
        maxsize 100M
        keep 5
        compression enabled
    }
    
  • /var/log/app.log {
        size 100M
        rotate 5
        compress
    }
    
  • /var/log/app.log {
        size 100M
        rotate 5
        delaycompress
    }
    
  • /var/log/app.log {
        weekly
        rotate 5
        compress
    }
    
CompTIA Linux+ XK0-006 (V8)
Security
Your Score:
Settings & Objectives
Random Mixed
Questions are selected randomly from all chosen topics, with a preference for those you haven’t seen before. You may see several questions from the same objective or domain in a row.
Rotate by Objective
Questions cycle through each objective or domain in turn, helping you avoid long streaks of questions from the same area. You may see some repeat questions, but the distribution will be more balanced across topics.

Check or uncheck an objective to set which questions you will receive.

Bash, the Crucial Exams Chat Bot
AI Bot