Hello,
I have a script that redirects stdin to a "log file" ( like this
http://tldp.org/LDP/abs/html/redircb.html ). This script calls multiple curl threads with & ( running on background ).
The issue that i'm having is that sometimes 2 curl processes write on the same line. Example:
How it should be:
Code:
This is a log line from curl 1
This is a log line from curl 2
How it looks like sometimes ( it is random but happens daily ):
Code:
This is a This is a log line from curl 2
Or something like this:
Code:
This is a log line from This is a log line from curl 2
Do you have any ideas of how i could fix this problem? I am not sure if locking the file for write would help, as it could reduce performance.
Thanks!