1. Use the flock in the shell script,
http://linux.die.net/man/1/flock
2. Use flock in code
http://linux.die.net/man/2/flock
My sample.
1. Use the flock in the shell script,
http://linux.die.net/man/1/flock
2. Use flock in code
http://linux.die.net/man/2/flock
My sample.