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: atop -w and atop -r record and replay system activity

Linux
~/tips/tip-monitoring-atop-record-replay

atop -w /tmp/atop.raw 60 30

Records system and process statistics to a file and lets you step through them afterwards.

Slowdowns never happen while you’re watching. Something eats the CPU at 03:12, and by the time you open top it’s gone. atop can write what it sees to a file, so you can look at it later like a flight recorder.

atop -w /tmp/atop.raw 60 30
atop -r /tmp/atop.raw

The first command writes a raw file with one sample every 60 seconds, thirty times. The second opens it in the normal atop screen. In replay, t shows the next sample and T the previous one. b jumps to a timestamp and r rewinds to the start.

To look at a specific stretch, add -b and -e with a time in the form hhmm:

atop -r /var/log/atop/atop_20261130 -b 0300 -e 0330

If you run atop -r without a file name, it opens today’s file in /var/log/atop/. Debian’s packaging keeps such a daily file by default, with a sample every 600 seconds and 28 days of history (settings in /etc/default/atop). Other distros may differ.

One caveat: the raw file contains process data for the whole system, so treat it as private and don’t send it around. A short interval over a long time also makes it grow quickly.

Further reading: atop man page (Debian), atop project

Going deeper: Keep a domain pointed at your home with Cloudflare DDNS on Unraid

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