Hunter的大杂烩 技术学习笔记

2014-09-11

bash flock

Filed under: 技术话题 — hunter @ 9:34 pm
#!/bin/bash
{
flock -xn 3
if [ $? -ne 0 ];then
echo “Aready runing…”
exit 1
fi
do some thing here

} 3<>/tmp/`basename $0`.lock


No Comments

No comments yet.

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Powered by WordPress