###### perpare 2 Copy all libs to other machine oper ############
cd /usr
find . -type f -mmin -30 -cmin -30 > list
find . -type l -mmin -30 -cmin -30 >> list
[root@localhost usr]# cat cp.sh
###############################################
#!/bin/bash
DEST= GST-1.14.1
rm -rf $DEST;mkdir -p $DEST
cd /usr
for i in `cat list`;do
P=`dirname $i`
if [ ! -d $DEST/$P ];then
echo " ------------------------------------------------------ mkdir $DEST/$P"
mkdir -p $DEST/$P;
fi;
'cp' -av $i $DEST/$P
done
#################################################
tar cJf DEST.tar.xz list cp.sh GST-1.14.1
### dest machine copy operation #####################
#!/bin/bash
SRC=GST-1.14.1
for i in `cat list`;do
DEST=/usr
P=`dirname $i`
if [ ! -d $DEST/$P ];then
echo "-------------------------------------------------------- mkdir $DEST/$P"
#mkdir -p $DEST/$P;
fi;
echo 'cp' -a ${SRC}/$i $DEST/$P
done
#################################################
阅读(598) | 评论(0) | 转发(0) |