Exercise 3: logrotate Directives and Testing With -d — Possible Solution ==================================================================== WHAT rotate 14 DOES ------------------------------ Per this chapter's own directive table, rotate 14 means "keep 14 old rotated copies before deleting the oldest." Each time the log rotates, one new rotated copy is added and, once 14 old copies already exist, the oldest one is discarded to make room - keeping the total history bounded rather than growing forever. WHAT compress DOES ------------------------------ Per this chapter's own directive table, compress means the tool will "gzip rotated files once they're no longer the active log." Only past, already-rotated copies get compressed - the currently active log file being actively written to is left uncompressed. WHY TESTING WITH logrotate -d IS GOOD PRACTICE ------------------------------ Per this chapter's own tip box, "logrotate -d /etc/logrotate.d/myapp runs in debug mode - it shows exactly what logrotate WOULD do without actually touching any files, letting you confirm the configuration behaves as intended before it runs for real on a schedule." Since logrotate typically runs unattended on a schedule (e.g. via cron), a misconfigured rule could silently do the wrong thing - delete files too aggressively, fail to rotate at all, or apply the wrong permissions - with nobody noticing until real logs are actually lost. Testing with -d catches this in advance, safely, since no files are actually modified during a dry run. WHY THIS WORKS AS AN ANSWER ------------------------------ It correctly explains what rotate 14 and compress each individually control, and correctly explains why a dry-run test matters specifically because logrotate normally runs unattended, where a silent misconfiguration could go unnoticed until real damage occurs.