]> git.ipfire.org Git - thirdparty/systemd.git/commit
journalctl: New option --cursor-file
authorJörg Sommer <joerg@jo-so.de>
Mon, 11 Feb 2019 23:19:13 +0000 (00:19 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 27 Feb 2019 17:43:31 +0000 (18:43 +0100)
commitd9e15cbd188438735f386bc7b50e193094fb79b4
treedc38eaeb6cd1f8a80d188ee4c85be46a2ef37666
parent200fb167a2e5353d0ac6e1f8a5d89bbad3842692
journalctl: New option --cursor-file

The option cursor-file takes a filename as argument. If the file exists and
contains a valid cursor, this is used to start the output after this position.
At the end, the last cursor gets written to the file.

This allows for an easy implementation of a timer that regularly looks in the
journal for some messages.

    journalctl --cursor-file err-cursor -b -p err
    journalctl --cursor-file audit-cursor -t audit --grep DENIED

Or you might want to walk the journal in steps of 10 messages:

    journalctl --cursor-file ./curs -n10 --since=today -t systemd
man/journalctl.xml
shell-completion/bash/journalctl
shell-completion/zsh/_journalctl
src/journal/journalctl.c