Linux Labs

Packages, services, and logs / Stage 12 of 13

Log rotation and retention

Not running Starting usually ~20 s
Leave the lesson

Step 9 of 9 · summary · 2 min

Summary

  • logrotate renames the log, shifts the old files and creates a new one according to the create line; it checks conditions when it runs.
  • --debug prints the rotation plan and changes nothing.
  • journald rotates the systemd journal itself; SystemMaxUse limits its growth, --vacuum-size removes archives, the active file stays.
  • After rotation, check both the old text in .1 and the program's write to the new log.
  • At the start of the lesson logrotate described a rename, yet the files did not change: the --debug option only showed the plan.
Ubuntu 24.04
Loading…