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: SyncIntervalSec in journald.conf explains why the last lines before a crash may be missing

Linux
~/tips/tip-journalctl-sync-interval-crit-first

[Journal]

Sets how often journald syncs its files to disk, which decides how much a crash can lose.

A machine that loses power can lose its last log lines, and this setting is the reason.

journald writes to files and syncs them to disk on a timer, five minutes by default. The sync happens at once after a message of priority crit, alert or emerg, so the worst news is safe. Lower SyncIntervalSec= if you want less to be at risk, at the price of more disk writes.

[Journal]
SyncIntervalSec=1min

Messages from the last minutes before a hard power loss can still be missing. A UPS or a clean shutdown protects better than any setting.

Further reading: journald.conf(5) manual page

More Linux tips a2query -m rewrite renice -n 10 -p 4242 cat config.yml | xsel -ib xvfb-run -a your-program --some-flag dpkg --get-selections > packages.txt All Linux tips (261) All topics

Link