Answer the question
In order to leave comments, you need to log in
How to properly clean logs in journald (systemd)
Faced with the fact that the logs /var/log/journal/
began to occupy more than a gig.
$ journalctl --disk-usage
Journals take up 1010.5M on disk.
journalctl
does not contain any parameters and options that allow you to delete old entries: for example, those made before a certain date. /etc/systemd/journald.conf
- there is only about limiting the size of magazines. journald
did not cut the logs. Answer the question
In order to leave comments, you need to log in
To clear the logs according to the conditions: to a date or cut to such and such a size (in the number of records or in MB), you can use the built-in commands:
journalctl --vacuum-size=128M
journalctl --vacuum-time=1d
At the moment, I found only an offer on the net to stupidly delete the contents of the folder /var/log/journal/
.
I did not delete everything, but only the files " *.journal~
".
The folder is lighter by 600M. I don't see any bugs in my work.
But cleaning according to the conditions is of interest: to a date or cut to such and such a size (in the number of records or in MB).
On this issue, everything is well described on the Arch Wiki https://wiki.archlinux.org/index.php/Systemd_(%D0%...
$ pacman -Qi systemd
Название : systemd
Версия : 208-3
...
$ sudo systemctl start systemd-journal-flush
sudo journalctl --disk-usage
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question