1

I need a server that should receive data streams, store them in files and send further. Each connection should create a file with corresponding timestamp in file name, then write to it.

My solution:

nc -l -k -p 4000 | date +"%Y-%m-%d_%H_%M_%S" | xargs -I {} tee file_{}.dat | nc 192.168.0.3 4001

It worked before decision about timestamps and separate files was made, but now I'm stuck on creation of files. netcat complains: getaddrinfo: name or service not known

1 Answers1

0

You can't. EOF is not piped to the next command when a connection ends. See this other answer