Total Questions
25
Answered
0
Score
0
Timer
20:00
Result
Question 1
Not answered
What is logrotate used for in Linux?
Explanation: logrotate manages log files by rotating them, compressing old logs, deleting old logs, and creating new log files.
Question 2
Not answered
Why is logrotate important for `/var`?
Explanation: Logs are commonly stored in `/var/log`. Without rotation, they can grow and fill `/var`, causing service and system issues.
Question 3
Not answered
Which directory usually stores Linux log files?
Explanation: `/var/log` is the standard directory for system and application log files.
Question 4
Not answered
What is the main logrotate configuration file?
Explanation: The main logrotate configuration file is `/etc/logrotate.conf`.
Question 5
Not answered
Where are service-specific logrotate configuration files commonly stored?
Explanation: Service-specific logrotate rules are commonly stored inside `/etc/logrotate.d/`.
Question 6
Not answered
What does the `daily` option mean in a logrotate config?
Explanation: `daily` tells logrotate to rotate the matching logs every day.
Question 7
Not answered
What does `rotate 7` mean?
Explanation: `rotate 7` means logrotate keeps 7 old rotated log files before deleting older ones.
Question 8
Not answered
What does the `compress` option do?
Explanation: `compress` compresses older rotated logs, usually with gzip, to save disk space.
Question 9
Not answered
What does the `missingok` option mean?
Explanation: `missingok` tells logrotate not to fail or complain if a listed log file does not exist.
Question 10
Not answered
What does the `notifempty` option mean?
Explanation: `notifempty` prevents rotation of empty log files.
Question 11
Not answered
What does `create 0640 root root` mean?
Explanation: The `create` option creates a fresh log after rotation with specified permissions, owner, and group.
Question 12
Not answered
Which command tests logrotate in debug mode without actually rotating logs?
Explanation: `logrotate -d` runs in debug mode and shows what would happen without making changes.
Question 13
Not answered
Which command forces logrotate to rotate logs immediately?
Explanation: `logrotate -f` forces rotation immediately, even if logrotate does not think rotation is due yet.
Question 14
Not answered
Where does logrotate commonly store its status file?
Explanation: logrotate commonly uses `/var/lib/logrotate/status` to track when logs were last rotated.
Question 15
Not answered
Which option can rotate logs when they reach a certain size?
Explanation: `size 100M` tells logrotate to rotate the log when it reaches 100 MB.
Question 16
Not answered
What does the `dateext` option do?
Explanation: `dateext` adds a date suffix to rotated logs, making them easier to identify by date.
Question 17
Not answered
What is the purpose of `copytruncate`?
Explanation: `copytruncate` is useful when an application cannot close and reopen its log file. It keeps the original file path active.
Question 18
Not answered
What is one risk of using `copytruncate`?
Explanation: During the brief copy and truncate process, some log lines may be written and missed.
Question 19
Not answered
What is `postrotate` used for?
Explanation: `postrotate` is used to run commands after log rotation, such as reloading a service.
Question 20
Not answered
Why might a service need to be reloaded after log rotation?
Explanation: Some services need reload signals after rotation so they reopen their log files correctly.
Question 21
Not answered
Which command checks whether a logrotate systemd timer exists?
Explanation: `systemctl list-timers | grep logrotate` checks if logrotate is scheduled through a systemd timer.
Question 22
Not answered
Which command can find log files larger than 100 MB?
Explanation: The `find` command searches files larger than 100 MB and lists them with details.
Question 23
Not answered
Why should you avoid blindly deleting an active log file?
Explanation: A process can keep writing to a deleted file through an open file handle until the service is restarted or the handle is closed.
Question 24
Not answered
Which is a good long-term solution for a 5 GB application log?
Explanation: A proper logrotate rule controls log size, keeps a limited history, compresses old logs, and prevents repeated disk issues.
Question 25
Not answered
Which statement is correct about logrotate?
Explanation: logrotate is widely used in Linux production systems to manage growing logs safely and automatically.