2013년 12월 4일 수요일

중복 실행 방지 쉘 스크립트 (Duplicate Execution Prevention shell script)

check process id...



date=$(date +%y/%m/%d-%H:%M:%S)
pid=`ps -ef | grep "filename" | grep -v 'grep' | awk '{print $2}'`

if [ -z $pid ]
then
execute ....
else
echo $data "can not dual exec process!!!\r\n";
fi

댓글 없음: