1. 生成压缩包
#!/bin/bash
#
DATE=`date +%Y%m%d`
DEST_PATH=`dirname $0`
if test $DEST_PATH = ".";then
DEST_PATH=`pwd`
fi
echo DEST_PATH: $DEST_PATH
cd $DEST_PATH
rm -f test
cd /home
tar cf - `find test -type f | /usr/bin/grep -v test/tmp` | gzip -f > $DEST_PATH/test.tgz
#tar cf - test/works test/stubs test/app.bin | gzip -f > $DEST_PATH/test.tgz
echo "生成更新包完毕"
2.更新
#!/bin/bash
#
DATE=`date +%Y%m%d`
PACK_PATH=`dirname $0`
if test $PACK_PATH = ".";then
PACK_PATH=`pwd`
fi
echo PACK_PATH: $PACK_PATH
cd /home
cp -r test test$DATE
cat $PACK_PATH/test.tgz | gunzip -f - | tar xf -
echo "更新完毕"
阅读(1290) | 评论(0) | 转发(0) |