journal space usage

I have two folders inside /var/log/journal

  1. [xxxxx]
  2. [xxxxx].netdata

Disk usage is freed up on folder 1 when I run journalctl --vacuum… The other one stays the same.

Is is safe to delete/vacuum/rotate the folder /var/log/journal/[xxxxxxxx].netdata ? Is yes, how?

Thanks

The folder ending in .netdata is a journal namespace, set by systemd (the Netdata systemd service unit defines this - in order for Netdata logs to be isolated and not pollute your system logs).

Generally, you can vacuum it like this:

sudo journalctl --namespace=netdata --vacuum-size=100M

If your journalctl does not support the --namespace parameter, you can run it like this:

sudo journalctl --directory=/var/log/journal/<machine-id>.netdata --vacuum-size=100M

If you have a newer systemd version (I believe v248+), you can define the max size you want for netdata:

# /etc/systemd/journald@netdata.conf
[Journal]
SystemMaxUse=100M

For older versions, the only solution to change the default retention, is to have a cron job running vacuum regularly.

Thank you! Worked perfectly