From 93aebe7498b3f3bf5079e4f218072b0ec5ad9b6c Mon Sep 17 00:00:00 2001 From: Joe Rayhawk Date: Sun, 27 Oct 2019 23:31:51 -0700 Subject: Minor and incomplete changes to cope with autolog path changes and kraken v3 shutdown --- bash/logtail | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 bash/logtail (limited to 'bash/logtail') diff --git a/bash/logtail b/bash/logtail new file mode 100755 index 0000000..361d121 --- /dev/null +++ b/bash/logtail @@ -0,0 +1,10 @@ +#!/bin/bash +( + echo -n "$1"/ + ls -tc "$1" | head -n 1 + inotifywait -q -m --exclude=xz -e CREATE --format %f "$1" +) | while read line; do + trap "jobs -rp | xargs --no-run-if-empty kill" EXIT; + jobs -rp | xargs --no-run-if-empty kill; + tail -F "$line" & +done -- cgit v1.2.3