Jump to content

Managing Systemd journal files


sunrat

Recommended Posts

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...