LinuxForum.Fans
Тема

Очистка /var/log/journal/

Автор: u________8 10 сообщений 5445 просмотров
#356679

В последнее время /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/ ?

#356683
"Ярослав" написал:
- как уменьшить аппетит в будущем?
"man journald.conf"
text

...
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

text

[Journal]
SystemMaxUse=100M
#356685
"Ярослав" написал:
Чем грозит просто удалить содержимое /var/log/journal/ ?

...тем, что не сможете просмотреть старые журналы.

"Ярослав" написал:
PS опробовал решение отсюда http://archlinux.org.ru/forum/topic/11477/
как было 1,5Гб, так и осталось.

Покажите

text

ls -l /var/log/journal/
#356686
"Ярослав" написал:
как было 1,5Гб, так и осталось.

Сервис перезапусти.

#356687

Ярослав,
Покажите:

text
cat /etc/systemd/journald.conf
"Ярослав" написал:
Чем грозит просто удалить содержимое /var/log/journal/ ?

Ничем не грозит. Удаляйте смело.

#356690

Lupo Alberto, прописал SystemMaxUse=50M, но ничего не изменилось

verg

Показать
$ cat /etc/systemd/journald.conf
# 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

verg написал:
Ничем не грозит. Удаляйте смело.
, отлично, спасибо.
#356691
"Ярослав" написал:
прописал SystemMaxUse=50M, но ничего не изменилось
"A.T.W.A." написал:
Сервис перезапусти.
#356696

Ярослав,
Можно и просто систему перезагрузить. (сперва удалите ненужное)

#356697

# /service journald restart# systemctl restart journald.service
:'( *WALL* :|

#356698

journald.service systemd-journald.service

Войдите или зарегистрируйтесь, чтобы ответить.