3

On Ubuntu, /var/log/journal grows too large. I am told I can safely delete /var/log/journal/* but I'd rather have a quota set.

How do I do this?

1 Answer 1

1

Edit /etc/systemd/journald.conf:

  • To set a total limit for all journal files, specify it in SystemMaxUse=.
  • To set a limit for individual files (and enforce more frequent rotation), use SystemMaxFileSize=.
  • Run journalctl --vacuum to enforce new limits.

For example:

[Journal]
# Total limit for all journals:
SystemMaxUse=4G
# Limit for individual files before rotation:
SystemMaxFileSize=1G
4
  • journalctl: option '--vacuum' is ambiguous; possibilities: '--vacuum-size' '--vacuum-files' '--vacuum-time'
    – spraff
    Commented Jun 30, 2019 at 20:09
  • My mistake, I thought they had added an option to automatically apply new journald.conf limits. I guess you'll have to use one of the manual options it offers you. Or possibly --rotate might do the job, as limits are generally applied during log rotation. Commented Jun 30, 2019 at 20:12
  • As the manual page says these days, journald.conf shows the compiled-in defaults, and one can just leave it alone and create e.g. /etc/systemd/journald.conf.d/local-maxuse.conf for local modifications. Commented Nov 5, 2023 at 9:44
  • Also, journalctl: option '--vacuum' is ambiguous; possibilities: '--vacuum-size' '--vacuum-files' '--vacuum-time' Commented Nov 5, 2023 at 9:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .