man journalctl--vacuum-size=, --vacuum-time=, --vacuum-files=
Removes the oldest archived journal files until the disk space they
use falls below the specified size (specified with the usual "K",
"M", "G" and "T" suffixes), or all archived journal files contain
no data older than the specified timespan (specified with the usual
"s", "m", "h", "days", "months", "weeks" and "years" suffixes), or
no more than the specified number of separate journal files remain.
Note that running --vacuum-size= has only an indirect effect on the
output shown by --disk-usage, as the latter includes active journal
files, while the vacuuming operation only operates on archived
journal files. Similarly, --vacuum-files= might not actually reduce
the number of journal files to below the specified number, as it
will not remove active journal files.
--vacuum-size=, --vacuum-time= and --vacuum-files= may be combined
in a single invocation to enforce any combination of a size, a time
and a number of files limit on the archived journal files.
Specifying any of these three parameters as zero is equivalent to
not enforcing the specific limit, and is thus redundant.
These three switches may also be combined with --rotate into one
command. If so, all active files are rotated first, and the
requested vacuuming operation is executed right after. The rotation
has the effect that all currently active files are archived (and
potentially new, empty journal files opened as replacement), and
hence the vacuuming operation has the greatest effect as it can
take all log data written so far into account.
man journald.confSystemMaxUse=, SystemKeepFree=, SystemMaxFileSize=, SystemMaxFiles=,
RuntimeMaxUse=, RuntimeKeepFree=, RuntimeMaxFileSize=, RuntimeMaxFiles=
Enforce size limits on the journal files stored. The options
prefixed with "System" apply to the journal files when stored on a
persistent file system, more specifically /var/log/journal. The
options prefixed with "Runtime" apply to the journal files when
stored on a volatile in-memory file system, more specifically
/run/log/journal. The former is used only when /var is mounted,
writable, and the directory /var/log/journal exists. Otherwise,
only the latter applies. Note that this means that during early
boot and if the administrator disabled persistent logging, only the
latter options apply, while the former apply if persistent logging
is enabled and the system is fully booted up. journalctl and
systemd-journald ignore all files with names not ending with
".journal" or ".journal~", so only such files, located in the
appropriate directories, are taken into account when calculating
current disk usage.
SystemMaxUse= and RuntimeMaxUse= control how much disk space the
journal may use up at most. SystemKeepFree= and RuntimeKeepFree=
control how much disk space systemd-journald shall leave free for
other uses. systemd-journald will respect both limits and use the
smaller of the two values.
The first pair defaults to 10% and the second to 15% of the size of
the respective file system, but each value is capped to 4G. If the
file system is nearly full and either SystemKeepFree= or
RuntimeKeepFree= are violated when systemd-journald is started, the
limit will be raised to the percentage that is actually free. This
means that if there was enough free space before and journal files
were created, and subsequently something else causes the file
system to fill up, journald will stop using more space, but it will
not be removing existing files to reduce the footprint again,
either. Also note that only archived files are deleted to reduce
the space occupied by journal files. This means that, in effect,
there might still be more space used than SystemMaxUse= or
RuntimeMaxUse= limit after a vacuuming operation is complete.
SystemMaxFileSize= and RuntimeMaxFileSize= control how large
individual journal files may grow at most. This influences the
granularity in which disk space is made available through rotation,
i.e. deletion of historic data. Defaults to one eighth of the
values configured with SystemMaxUse= and RuntimeMaxUse=, so that
usually seven rotated journal files are kept as history.
Specify values in bytes or use K, M, G, T, P, E as units for the
specified sizes (equal to 1024, 1024², ... bytes). Note that size
limits are enforced synchronously when journal files are extended,
and no explicit rotation step triggered by time is needed.
SystemMaxFiles= and RuntimeMaxFiles= control how many individual
journal files to keep at most. Note that only archived files are
deleted to reduce the number of files until this limit is reached;
active files will stay around. This means that, in effect, there
might still be more journal files around in total than this limit
after a vacuuming operation is complete. This setting defaults to
100.