Hi folks,

I'm using netcat in listening mode to act as a server that sends out realtime streaming data piped in from stdin. The streaming data is also saved in a text file via tee.

i.e.
$ ./streamingDataScript.sh | tee -a streaming.log | nc -l -k -v $PORT

btw -a is append,
-l is listen, -k is persist in listening (ie no exit after client close) and -v is more verbose ouput

my problem is that if a client is not connected to the netcat server, the data from the script doesn't/stops getting written to the file streaming.log.

Can anybody offer some help on what the problem might be or a workaround so that the data is always going into the file regardless of a connection at netcat?

thanks
Piers