There is a point to this story, but it has temporarily escaped my mind...
Contact Me MyFaceBook MyLinkedIn MyGitHub MyTwitter

Clear SystemD Journal

On any server, the logs can start to add up and take considerable amount of disk space. Systemd conveniently stores these in /var/log/journal and has a systemctl command to help clear them.

Clear systemd journals older than X days

The first one is time-based, clearing everything older than say 10 days.

$ journalctl --vacuum-time=10d
...
Vacuuming done, freed 2.3G of archived journals on disk.

Alternatively, you can limit its total size.

Clear systemd journals if they exceed X storage

This example will keep 2GB worth of logs, clearing everything that exceeds this.

$ journalctl --vacuum-size=2G
...
Vacuuming done, freed 720.0M of archived journals on disk.

Afterwards, your /var/log/journal should be much smaller.

Copyright © 2022 by Julian Easterling. SOME RIGHTS RESERVED.
Privacy Policy              Terms of Use             


Creative Commons License
Except where otherwise noted, content on this site is
licensed under a Creative Common Attribution-Share Alike 4.0 International License.


All of the opinions expressed on this website are those of Julian Easterling and
do not represent the views of any of my current and previous clients or employers in any way.

If you notice an error on the site or content that has not been properly attributed, bring
it to my attention using the contact page and I will endeavor to fix it as soon as I can.

I accept no responsibility or liability for any damages incurred by following any of
my advice or by using any of the information on my site or of those sites that I link to.