summaryrefslogtreecommitdiff
path: root/shell-completion
diff options
context:
space:
mode:
authorJörg Sommer <joerg@jo-so.de>2019-02-12 00:19:13 +0100
committerLennart Poettering <lennart@poettering.net>2019-02-27 18:43:31 +0100
commitd9e15cbd188438735f386bc7b50e193094fb79b4 (patch)
treedc38eaeb6cd1f8a80d188ee4c85be46a2ef37666 /shell-completion
parent200fb167a2e5353d0ac6e1f8a5d89bbad3842692 (diff)
downloadsystemd-d9e15cbd188438735f386bc7b50e193094fb79b4.tar.gz
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
Diffstat (limited to 'shell-completion')
-rw-r--r--shell-completion/bash/journalctl2
-rw-r--r--shell-completion/zsh/_journalctl1
2 files changed, 2 insertions, 1 deletions
diff --git a/shell-completion/bash/journalctl b/shell-completion/bash/journalctl
index bcd4533a63..f2e882ca00 100644
--- a/shell-completion/bash/journalctl
+++ b/shell-completion/bash/journalctl
@@ -48,7 +48,7 @@ _journalctl() {
-M --machine -o --output -u --unit --user-unit -p --priority
--root --case-sensitive'
[ARGUNKNOWN]='-c --cursor --interval -n --lines -S --since -U --until
- --after-cursor --verify-key -g --grep
+ --after-cursor --cursor-file --verify-key -g --grep
--vacuum-size --vacuum-time --vacuum-files --output-fields'
)
diff --git a/shell-completion/zsh/_journalctl b/shell-completion/zsh/_journalctl
index aa6ace0485..a4df88ef4b 100644
--- a/shell-completion/zsh/_journalctl
+++ b/shell-completion/zsh/_journalctl
@@ -104,6 +104,7 @@ _arguments -s \
{-p+,--priority=}'[Show only messages within the specified priority range]:priority:_journalctl_field_values PRIORITY' \
{-t+,--identifier=}'[Show only messages with the specified syslog identifier]:identifier:_journalctl_field_values SYSLOG_IDENTIFIER' \
{-c+,--cursor=}'[Start showing entries from the specified cursor]:cursors:_journalctl_field_values __CURSORS' \
+ '--cursor-file=[Show entries using cursor store in file]:file:_files' \
'--after-cursor=[Start showing entries from after the specified cursor]:cursors:_journalctl_field_values __CURSORS' \
'--since=[Start showing entries on or newer than the specified date]:YYYY-MM-DD HH\:MM\:SS' \
'--until=[Stop showing entries on or older than the specified date]:YYYY-MM-DD HH\:MM\:SS' \