diff options
author | Joe Rayhawk <jrayhawk@action.fairlystable.org> | 2019-10-27 23:31:51 -0700 |
---|---|---|
committer | Joe Rayhawk <jrayhawk@action.fairlystable.org> | 2019-10-27 23:31:51 -0700 |
commit | 93aebe7498b3f3bf5079e4f218072b0ec5ad9b6c (patch) | |
tree | 00e7c6af4563b910a715c842baa3c4e8a68e4822 /bash/logtail | |
parent | c11cd7da47327b423f40c9cd54d2c8f9612cea5a (diff) | |
download | twitchtools-93aebe7498b3f3bf5079e4f218072b0ec5ad9b6c.tar.gz twitchtools-93aebe7498b3f3bf5079e4f218072b0ec5ad9b6c.zip |
Minor and incomplete changes to cope with autolog path changes and kraken v3 shutdown
Diffstat (limited to 'bash/logtail')
-rwxr-xr-x | bash/logtail | 10 |
1 files changed, 10 insertions, 0 deletions
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 |