Jump to content
sunrat

Managing Systemd journal files

Recommended Posts

sunrat

I just did a full upgrade and noticed my disk space was getting over 80% so time for spring cleaning. Did the usual apt clean, remove kernels and clear superfluous downloads, but on running Filelight I noticed /var/log/journal/ was about 1.2GB. I'm pretty sure I won't need to look up journal entries from months (or a year) ago or even days, so looked into ways to reduce the stored journal files.

The recommended way is to use journalctl and you can choose what or how much to remove:

journalctl --vacuum-size=50M  #delete files until the disk space they use falls below the specified size
journalctl --vacuum-time=1years	#delete files so that all journal files contain no data older than the specified timespan
journalctl --vacuum-files=4     #delete files so that no more than the specified number of separate journal files remain in storage location

 

Need to be run as root or sudo.

 

Thanks to https://www.tecmint.com/manage-systemd-logs-using-journalctl/ and well worth a read for stacks of other things you can do with the systemd journal.

  • Like 2

Share this post


Link to post
Share on other sites
securitybreach

Nice, I'll have to check that out after I get back from the holiday. Thanks :thumbsup:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...