Folosesc journald cu înregistrarea în memorie limitată la 55MB. Dar cumva, acest lucru echivalează cu mai puțin de o zi de exploatare.
Configurare:
$ grep -v '^#' /etc/systemd/journald.conf
[Jurnal]
Stocare=volatil
RuntimeMaxUse=50M
RuntimeKeepFree=75M
RuntimeMaxFileSize=5M
RuntimeMaxFiles=100
ForwardToSyslog=da
MaxLevelSyslog=depanare
Utilizarea discului:
$ journalctl --disk-usage
Jurnalele arhivate și active ocupă 55,0 milioane în sistemul de fișiere.
Dimensiunea necomprimată a rezultatului journalctl este de 3,1 M:
journalctl >jurnalele; du -h busteni
3,1 milioane de jurnaluri
Dimensiunea comprimată este de 153K:
$ journalctl |gzip >logs.gz; du -h logs.gz
153K logs.gz
ACTUALIZAȚI:
Chiar și atunci când utilizați journalctl -a -o verbose
Datele de ieșire folosesc jumătate din ceea ce consumă journald:
$ journalctl -a -o verbose >foo; df -h foo
27 de milioane de foo
Și se comprimă la o 50 din ceea ce consumă journald:
$ journalctl -a -o verbose |gzip >foo.z; du -h foo.z
1,7 milioane foo.z
TERMINAT UPDATE
Jurnalele sunt sănătoase conform journalctl --verify:
$ journalctl --verify
PASS: /run/log/journal/69357476ee55415c8407fc9f84dc235d/system.journal
PASS: /run/log/journal/69357476ee55415c8407fc9f84dc235d/system@93c2aae90b5b4ecaacf0d7339c8f33b2-000000000000e845-003000000e845-003000000e845-0032bjod
PASS: /run/log/journal/69357476ee55415c8407fc9f84dc235d/system@93c2aae90b5b4ecaacf0d7339c8f33b2-000000000000db61-0853638b4ecaacf0d7339c8f33b2-000000000000db61-0853636363
PASS: /run/log/journal/69357476ee55415c8407fc9f84dc235d/system@93c2aae90b5b4ecaacf0d7339c8f33b2-000000000000ce71-00600000000000000000.
PASS: /run/log/journal/69357476ee55415c8407fc9f84dc235d/system@93c2aae90b5b4ecaacf0d7339c8f33b2-000000000000c18f-0d815a2
PASS: /run/log/journal/69357476ee55415c8407fc9f84dc235d/system@93c2aae90b5b4ecaacf0d7339c8f33b2-000000000000b4b6-060000000b4b6-0600000000000000000000000000000000000000000000000000000000000000000000000000.
PASS: /run/log/journal/69357476ee55415c8407fc9f84dc235d/system@93c2aae90b5b4ecaacf0d7339c8f33b2-000000000000a7ca-000005ff80bb.journal1ff8
PASS: /run/log/journal/69357476ee55415c8407fc9f84dc235d/system@93c2aae90b5b4ecaacf0d7339c8f33b2-0000000000009ade-00825c280f.
PASS: /run/log/journal/69357476ee55415c8407fc9f84dc235d/system@93c2aae90b5b4ecaacf0d7339c8f33b2-0000000000008e05-00000008e05-00900008e05-00000000000000008
PASS: /run/log/journal/69357476ee55415c8407fc9f84dc235d/system@93c2aae90b5b4ecaacf0d7339c8f33b2-0000000000008118-00c2aae90b5b4ecaacf0d7339c8f33b2-0000000000008118-00c2aae65e18
PASS: /run/log/journal/69357476ee55415c8407fc9f84dc235d/system@93c2aae90b5b4ecaacf0d7339c8f33b2-000000000000742e-0400000742e-008065b5b4ecaacf0d7339c8f33b2
$ ls -alh /run/log/journal/69357476ee55415c8407fc9f84dc235d/
total 55 milioane
drwxr-s---+ 2 root systemd-journal 260 Jul 27 11:53 .
drwxr-sr-x 3 root systemd-journal 60 Jul 26 15:42 ..
-rw-r-----+ 1 rădăcină systemd-journal 5.0M 27 iulie 02:08 system@93c2aae90b5b4ecaacf0d7339c8f33b2-000000000000742e-0005c80816.journal4
-rw-r-----+ 1 root systemd-journal 5.0M 27 iulie 03:13 system@93c2aae90b5b4ecaacf0d7339c8f33b2-0000000000008118-0005c808f6e12c0d.journal
-rw-r-----+ 1 root systemd-journal 5.0M 27 iulie 04:18 system@93c2aae90b5b4ecaacf0d7339c8f33b2-0000000000008e05-0005c809dfaf56f
-rw-r-----+ 1 root systemd-journal 5.0M Jul 27 05:23 system@93c2aae90b5b4ecaacf0d7339c8f33b2-0000000000009ade-0005c80ac8242caf.
-rw-r-----+ 1 root systemd-journal 5.0M 27 iulie 06:28 system@93c2aae90b5b4ecaacf0d7339c8f33b2-000000000000a7ca-0005c80bb0d1ff50.
-rw-r-----+ 1 root systemd-journal 5.0M 27 iulie 07:33 system@93c2aae90b5b4ecaacf0d7339c8f33b2-000000000000b4b6-0005c80c9979b
-rw-r-----+ 1 root systemd-journal 5.0M 27 iulie 08:38 system@93c2aae90b5b4ecaacf0d7339c8f33b2-000000000000c18f-0005c80d81a2f3
-rw-r-----+ 1 root systemd-journal 5.0M 27 iulie 09:43 system@93c2aae90b5b4ecaacf0d7339c8f33b2-000000000000ce71-0005c80e6a86dafe.
-rw-r-----+ 1 root systemd-journal 5.0M 27 iulie 10:48 system@93c2aae90b5b4ecaacf0d7339c8f33b2-000000000000db61-0005c80f5363b8
-rw-r-----+ 1 root systemd-journal 5.0M 27 iulie 11:53 system@93c2aae90b5b4ecaacf0d7339c8f33b2-000000000000e845-0005c8103bd2043
-rw-r-----+ 1 rădăcină systemd-journal 5.0M 27 iulie 12:18 system.journal
Deci, de ce și cum utilizează journald de 359 de ori mai mult spațiu pentru a stoca ceea ce se comprimă ușor la 153K?
Ce ocupă 99,8% din spațiu și există vreo modalitate de a stoca mai multe date cu prețul acela de 99,8%?