Journalctl basic examples | Howto

I wanted to clean the journal to remove about 400MB of old logs. Unfortunately the docs not showed me any examples. There was just the man journalctl mentioned.

A quick search brought up this:

Might be, if someone who likes to update quick docs, could use this as an inspiration :point_up:.

2 Likes

This two examples showed how simple it can be:

  • journalctl --disk-usage Archived and active journals take up 384.0M on disk.
  • journalctl --vacuum-size=200M Deleted archived journal /run/log/
2 Likes

Wow!

Thanks for that @ilikelinux .
It seems I had 2.3G of journalctl logs and the vacuum removed 2.1G of that.

2 Likes
journalctl --vacuum-time=1days

In addition to --vacuum-size=, --vacuum-time= removes archived journal files older than the specified timespan. Accepts the usual s (default), m, h, days, weeks, months, and years suffixes.

1 Like

:broom: :wind_face:

Doing some journalctl cleanup

1 Like