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/
11 mydir
=$
(dirname "${BASH_SOURCE[0]}")
13 # flush before we get underway
14 killall
-s SIGUSR1 compresslog
16 ## setup trigger flush in a background loop
17 ( sleep 1 # give time for the tailing to get started
20 killall
-s SIGUSR1 compresslog
2>/dev
/null
22 if [ $err -eq 0]; then
23 echo "WARNING - ztail: compresslog is not running" >&2
24 echo "WARNING - ztail: or we are not root." >&2
31 trap "kill $FLUSHTRIGGERD" SIGHUP SIGINT SIGTERM
33 $mydir/zcatfollow
-n 10 $logfile