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 -o export makes a text-based copy of the journal you can move

Journalctl
~/tips/tip-journalctl-export-format-backup

journalctl -o export > journal.export

Writes journal entries with all their fields to a stream that can be stored or imported elsewhere.

A plain text dump loses the structure, and a copy of the binary files is fiddly. The export format keeps the fields.

-o export serialises the journal into a binary but mostly text-based stream. The man page calls it suitable for backups and network transfer, and systemd-journal-remote imports it back into the native format. It is a neat way to hand an expert the exact entries around a problem.

journalctl -o export > journal.export

The file is not meant for reading by eye. Filter first with -u and a time range, so you hand over only what is needed and not the whole machine.

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