May 10, 2010 #1 busster Technical User Joined Dec 13, 2004 Messages 960 Location 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
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
May 10, 2010 #2 North323 Technical User Joined Jan 13, 2009 Messages 966 Location US no but you can write a cron to send it there and have it just re-write every minute Upvote 0 Downvote
May 10, 2010 #3 m4ilm4n IS-IT--Management Joined Dec 22, 2004 Messages 312 Location US Take a look at netcat - it should do what you want (I had to doublecheck to make sure it would do outbound, I've only used it for inbound traffic). http://netcat.sourceforge.net/ Upvote 0 Downvote
Take a look at netcat - it should do what you want (I had to doublecheck to make sure it would do outbound, I've only used it for inbound traffic). http://netcat.sourceforge.net/
May 10, 2010 Thread starter #4 busster Technical User Joined Dec 13, 2004 Messages 960 Location US tail -f /var/log/error.log |nc 10.0.1.31 12000 seems to be working, but it does stop running sometimes. Upvote 0 Downvote
tail -f /var/log/error.log |nc 10.0.1.31 12000 seems to be working, but it does stop running sometimes.
May 10, 2010 #5 stefanwagner Programmer Joined Oct 19, 2003 Messages 2,373 Location DE maybe nohup and respawn help in avoiding termination. don't visit my homepage: http://home.arcor.de/hirnstrom/minis/index.html Upvote 0 Downvote
maybe nohup and respawn help in avoiding termination. don't visit my homepage: http://home.arcor.de/hirnstrom/minis/index.html
May 12, 2010 #6 m4ilm4n IS-IT--Management Joined Dec 22, 2004 Messages 312 Location US 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. Upvote 0 Downvote
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.