Stop losing your place when logs rotate at midnight

Logging & Journald

Stop losing your place when logs rotate at midnight

🧩 The Challenge

Trying to hunt down a bug that only happens during the nightly log rotation is a nightmare when journalctl jumps to the next file or stops dead. I’ve spent way too many nights guessing which file holds the timestamp I actually need.

💡 The Fix

Use the follow flag combined with a time filter to force the stream to persist across file boundaries. You’ll stop getting kicked out of your tail session right when things get interesting.

journalctl -u service-name -S "2023-10-27 23:55:00" -f

⚙️ Why It Works

Passing a start time tells the pager to grab the context from that point forward and stay latched onto the current stream even as journald archives the older data. It basically bridges the gap between static archives and the live tail.

🚀 Pro-Tip: Stick a -n 100 before the -f if you want a little context from before the window starts.

Linux Tips & Tricks | © ngelinux.com | 9/2/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted