|
发表于 2009-10-22 13:25:36
|
显示全部楼层
Sorry I cannot type Chinese now.
It is a good tip, but lockfile is not always available, especially in embedded systems.
I normally rename the file the script will work on to get the lock. For example- if mv foo.log foo.log.$$; then
- do something on foo.log.$$
- else
- exit 1
- fi
复制代码 mv command is atom operation in shell. |
|