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
28 ## setup trigger flush in a background loop
29 ( sleep 1 # give time for the tailing to get started
32 killall
-s SIGUSR1 compresslog
2>/dev
/null
34 if [ $err -eq 0]; then
35 echo "WARNING - ztail: compresslog is not running" >&2
36 echo "WARNING - ztail: or we are not root." >&2
43 trap "kill $FLUSHTRIGGERD" SIGHUP SIGINT SIGTERM
45 $mydir/zcatfollow
-n $taillines $logfile
47 kill $FLUSHTRIGGERD 2>/dev
/null