2 # Usage : ztail [ -n 10 ] /var/log/foo
4 # Implements ztail -f /var/log/foo
7 # Author: Martin Langhoff <martin.langhoff@gmail.com>
8 # Copyright: Remote Learner US - http://www.remote-learner.net/
10 mydir
=$
(dirname "${BASH_SOURCE[0]}")
25 # flush before we get underway
26 killall
-s SIGUSR1 compresslog
2>/dev
/null
28 echo "WARNING - ztail: compresslog is not running" >&2
29 echo "WARNING - ztail: or we are not root." >&2
32 ## setup trigger flush in a background loop
33 ( sleep 1 # give time for the tailing to get started
36 killall
-s SIGUSR1 compresslog
2>/dev
/null
40 trap "kill $FLUSHTRIGGERD" SIGHUP SIGINT SIGTERM
42 $mydir/zcatfollow
-n $taillines $logfile
44 kill $FLUSHTRIGGERD 2>/dev
/null