Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

tail command

Status
Not open for further replies.

busster

Technical User
Dec 13, 2004
959
US
Can I use the tail command to continuously send a log file to Windows?

Have tried:
tail -f /var/log/error.log 10.0.1.31 12000

I hoped this would send the error.log file to my windows pc on port 12000
 
no but you can write a cron to send it there and have it just re-write every minute
 
tail -f /var/log/error.log |nc 10.0.1.31 12000 seems to be working, but it does stop running sometimes.
 
I run mine as a script called by cron:
Code:
#!/bin/bash
#
killall netcat
sleep 4
FILE=`/bin/date +"%d-%m-%Y.txt"`
netcat -l -p 50000 > /cdr/html/$FILE &
rm /cdr/html/current.txt
ln -s /cdr/html/$FILE /cdr/html/current.txt

This is for capturing call detail recording from a phone switch, but the concept is similar. The cron entry runs this once a day to roll the logs.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top