How do I get a file ex: /var/log/messages to continualy be printed to a regular terminal?

Scott plug-discuss@lists.plug.phoenix.az.us
Tue, 4 Mar 2003 07:15:03 -0700 (MST)


I have something like this already set up on virtual terminals f9 thru f12 
(alt f9, atl f10, etc).  Here is the script that I run from cron 
everynight after log rotations are done:
--------------------------------
echo "Kill any tails that may be running"
#
ps -ef | grep -v grep | grep tail > /dev/null && ps -ef | grep -v grep | grep tail | awk '{print $2}' | xargs kill -9
#
echo "Enabling /dev/tty logging..."
tail -f /var/log/messages > /dev/tty9 &
tail -f /var/log/secure > /dev/tty10 &
tail -f /var/log/xferlog > /dev/tty11 &
tail -f /var/log/maillog > /dev/tty12 &
#
#tail -f /var/log/syslog > /dev/tty10 &
----------------------------

And here is the cron entry:

--------------------------
05 00 * * * /usr/local/sbin/log.to.ttys
--------------------------                                                                                                

Of course, if you dont rotate your logs daily, adjust the cron entry as 
needed.

scott

On 4 Mar 2003, Entelin wrote:

> How do I get a file ex: /var/log/messages to continualy be printed to a
> regular terminal? (just a normal text mode terminal, not a external
> display or anything) I want to set up one window for messages, another
> for named.run, etc.. I dont want a login prompt or anything on it.
> 
> Thanks :)
> 
> ---------------------------------------------------
> PLUG-discuss mailing list - PLUG-discuss@lists.plug.phoenix.az.us
> To subscribe, unsubscribe, or to change  you mail settings:
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
> 

-- 
NT makes anything simple, easy, and anything difficult to do, impossible.
Unix makes anything easy to do difficult, and anything difficult to do,
possible.  Basically, if your VCR is still flashing "12:00" then unix is not
for you!