#!/bin/bash
# Author : cold
# Filename : checkchange.sh
# Useage : sh checkchange.sh [dir]
checkisdir()
# Have one argument
# The argument is a directory
for i in `ls $1 | sed -e 's/ /\n/g'`
do
if [ -d $1/$i ]
then
if [ $i == "bin" -o $i == "lib" -o $i == "include" ] # 不想检测的目录(这里是使用virtualenv生成的环境文件)
then
continue
fi
dir="$1/$i"
checkisdir $dir
else
files=$files'\n'$1'/'$i
fi
done
echo -e $files
}
while true
do
if [ -e /tmp/stat.tmp ]
then
for i in `checkisdir $1`
do
if [ -e /tmp/patch.tmp ]
then
stat $i | grep Change > /tmp/nstat.tmp
rm -f /tmp/patch.tmp
continue
fi
stat $i | grep Change >> /tmp/nstat.tmp
done
diff /tmp/stat.tmp /tmp/nstat.tmp > /tmp/patch.tmp
if [ $? -eq 0 ]
then
sleep 10
else
/etc/init.d/uwsgi.py restart # 将此处更改为想要做的操作
patch /tmp/stat.tmp /tmp/patch.tmp
fi
else
for i in `checkisdir $1`
do
stat $i | grep Change >> /tmp/stat.tmp
done
continue
fi
done
#!/bin/bash
# Author : cold
# Filename : checkupdate.sh
# Describle : To Check update of svn
while true
do
cd /code/python
svn up | grep At > /dev/null 2>&1
if [ $? -eq 0 ]
then
sleep 30
fi
svn up | grep Updated > /dev/null 2>&1
if [ $? -eq 0 ]
then
/etc/init.d/uwsgi.py restart
fi
done
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有