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:.

4 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/
3 Likes

Wow!

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

3 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.

2 Likes

:broom: :wind_face:

Doing some journalctl cleanup

1 Like

sudo journalctl --rotate --vacuum-time=1days --vacuum-size=20M

1 Like