↑ ↓ select, Enter open, Esc close

Test a logrotate configuration without rotating

Adjust the values, the command updates live
root@server
logrotate -d /etc/logrotate.d/nginx

With -d, logrotate reads the configuration, reports syntax errors and describes for each log file whether and why it would be rotated. Nothing is changed, and the state file stays untouched as well. The output contains lines like log does not need rotating that explain why a rotation does not happen.

Note: If everything looks plausible, logrotate -vf with the same file forces a real rotation.

Also searched as

  • test logrotate config
  • why is my log not rotating
  • check logrotate configuration
  • logrotate dry run

Related one-liners

All in Logs

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.