Clean up harddrive space on Ubuntu Server with journalctl

After running for a while, an Ubuntu server tend to get bloated with… stuff. One particularly weird one is the disk usage of a bunch of /var/log/journal/* entries that hog a lot of space.

In my case, 2GB. This is significant on a machine with just 20GB of space. You can see their disk usage with:

journalctl --disk-usage

I honestly don’t know what the journals are for, but anyway, there is a quick solution to clean it up in an easy way:

journalctl --vacuum-size=100M

This command will “vacuum” the journal logs and free up space. More info in this Stack Exchange answer.

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.