brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: journalctl --sync makes sure every log line is on disk before you continue

Journalctl
~/tips/tip-journalctl-sync-now-before-reboot

sudo journalctl --sync

Forces journald to write all pending log data to disk and returns when it is done.

Before a risky step, like a kernel update or a firmware change, I want proof that the logs so far are safe.

--sync asks the journal daemon to write all pending data to the file system and synchronise the journals. It does not return until that is done, and every message written before the call is on disk when it returns.

sudo journalctl --sync

It does nothing for messages that were never sent to the journal, and it cannot save an in-memory journal across a reboot.

Further reading: journalctl(1) manual page

More Journalctl tips journalctl -k -g 'killed process' --since "2 days ago" journalctl _PID=1 -b ls -lh /var/log/journal/*/*.journal~ Storage=volatile sudo journalctl --setup-keys All Journalctl tips (81) All topics

Link