Linux Labs

Packages, services, and logs / Stage 12 of 13

Log rotation and retention

Not running Starting usually ~20 s
Leave the lesson

Step 4 of 9 · on a machine · 4 min

Clean the journal

The lab-vacuum journal namespace holds five one-megabyte files: four archives and the active one. Remove archives down to a 500K limit and see how much the journal takes.

Exercise · look

A limit smaller than the active file

The lab-vacuum journal namespace takes 5.0M: four archives and the active file, a megabyte each. Remove archives with a 500K limit and check how much the journal takes.

First, predict

What will --disk-usage show after --vacuum-size=500K?

Now start the exercise, run the command and compare your prediction with the output.

Sign in and start The machine is available after signing in

--vacuum-size removes archives only. The 1M active file stays, so --disk-usage does not drop below its size even if the limit is smaller. You can get rid of its records too by first turning it into an archive with --rotate — but journald immediately starts a new active file of the same size.

Ubuntu 24.04
Loading…