В последнее время /var/log/journal/ разрослась до неприличных размеров 1,5Гб.
Отсюда два вопроса:
- как почистить,
- как уменьшить аппетит в будущем?
Спасибо.
PS опробовал решение отсюда http://archlinux.org.ru/forum/topic/11477/
как было 1,5Гб, так и осталось:
[console]$ du -sh /var/log/journal/
1,5G /var/log/journal/[/console]
Чем грозит просто удалить содержимое /var/log/journal/ ?
Очистка /var/log/journal/
- как уменьшить аппетит в будущем?
"man journald.conf"
...
SystemMaxUse=, SystemKeepFree=, SystemMaxFileSize=, RuntimeMaxUse=, RuntimeKeepFree=, RuntimeMaxFileSize=
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 maximum. Defaults to 10% of the size of the
respective file system. SystemKeepFree= and RuntimeKeepFree= control how much disk space systemd-journald shall always leave free for
other uses. Defaults to 15% of the size of the respective file system. systemd-journald will respect both limits, i.e. use the smaller
of the two values. SystemMaxFileSize= and RuntimeMaxFileSize= control how large individual journal files may grow at maximum. 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.
...
Я, например, установил в /etc/systemd/journald.conf
[Journal]
SystemMaxUse=100M
Чем грозит просто удалить содержимое /var/log/journal/ ?
...тем, что не сможете просмотреть старые журналы.
PS опробовал решение отсюда http://archlinux.org.ru/forum/topic/11477/
как было 1,5Гб, так и осталось.
Покажите
ls -l /var/log/journal/
как было 1,5Гб, так и осталось.
Сервис перезапусти.
Ярослав,
Покажите:
cat /etc/systemd/journald.confЧем грозит просто удалить содержимое /var/log/journal/ ?
Ничем не грозит. Удаляйте смело.
Lupo Alberto, прописал SystemMaxUse=50M, но ничего не изменилось
verg
Показать
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
# See journald.conf(5) for details
[Journal]
#Storage=auto
#Compress=yes
#Seal=yes
#SplitMode=login
#RateLimitInterval=10s
#RateLimitBurst=200
SystemMaxUse=50M
#SystemKeepFree=
#SystemMaxFileSize=
#RuntimeMaxUse=
#RuntimeKeepFree=
#RuntimeMaxFileSize=
#MaxRetentionSec=
#MaxFileSec=1month
#ForwardToSyslog=yes
#ForwardToKMsg=no
#ForwardToConsole=no
#TTYPath=/dev/console
#MaxLevelStore=debug
#MaxLevelSyslog=debug
#MaxLevelKMsg=notice
#MaxLevelConsole=info
, отлично, спасибо.Ничем не грозит. Удаляйте смело.
прописал SystemMaxUse=50M, но ничего не изменилось
Сервис перезапусти.
Ярослав,
Можно и просто систему перезагрузить. (сперва удалите ненужное)
# /service journald restart# systemctl restart journald.service
:'( *WALL* :|
journald.service systemd-journald.service