Linux Survival Basics
Read-onlyDebug Logrotate Without Rotating
You need to see what logrotate would consider without changing files.
Command
logrotate -d /etc/logrotate.conf
Before you run this
System impact: Read-only. Low when scoped to the shown target.
When not to use it: Do not use force rotation until ownership, paths, and service reopen behavior are clear.
Expected output
Debug output showing configs read, log files considered, and rotation decisions.
System impact
Read-only. Nothing changes. The command reads current state and prints diagnostic evidence.
May require elevated permissions on protected paths or service-owned files.
Recovery / rollback: no state is changed.
When to use it
Use when logs are growing or rotation seems skipped.
When not to use it
Do not use force rotation until ownership, paths, and service reopen behavior are clear.
Example run
Commands shown
These are the commands shown for inspection. Treat them as an example, not proof that your system will behave identically.
logrotate -d /etc/logrotate.conflogrotate -d /etc/logrotate.conf
next steps
Related commands
Read Recent Logrotate Journal
The journal can show why rotation skipped.
journalctl -u logrotate --since '7 days ago' --no-pager
Fingerprint a Debian or Ubuntu Host
Before package triage, prove what OS family and release you are actually on.
. /etc/os-release && printf '%s %s %s\n' "$ID" "$VERSION_ID" "$VERSION_CODENAME"
Find Nginx root alias and access rules
One deny or alias can explain the whole 403.
grep -RInE 'root|alias|deny|allow' /etc/nginx/sites-enabled /etc/nginx/conf.d 2>/dev/null
Dry-Run Logrotate Before Touching Logs
Logrotate can explain its plan without rotating anything.
logrotate -d /etc/logrotate.conf 2>&1 | sed -n '/rotating pattern/p;/considering log/p;/error:/p'
Find Nginx SSL Certificate Directives
The wrong certificate is often in the server block.
grep -RInE 'ssl_certificate|ssl_certificate_key|server_name' /etc/nginx/sites-enabled /etc/nginx/conf.d 2>/dev/null
next diagnostic step
Where to go from this command
- Logrotate not running hub Use when logs are not rotating.
Study mapping
Use this as independent command practice: read the notes, predict the output, then compare it with the example before using a real shell.
Independent study support only. No affiliation, endorsement, exam dumps, or real exam questions.