#!/bin/bash
BAKUP_DIR="/home/zhangxiaotong/work/push_bak"
function bakdown()
{
curdir=`pwd`
if [ ! -e $BAKUP_DIR ]; then
echo "bakup directory is not exist!"
return
fi
cd $BAKUP_DIR
files=(`find . -type f`)
num=${#files[@]}
for ((i=0; i < $num; i++))
do
file=${files[i]}
tofile=`dirname ${curdir}`/${file}
cp -rf $file $tofile
done
}
bakdown
BAKUP_DIR="/home/zhangxiaotong/work/push_bak"
function bakdown()
{
curdir=`pwd`
if [ ! -e $BAKUP_DIR ]; then
echo "bakup directory is not exist!"
return
fi
cd $BAKUP_DIR
files=(`find . -type f`)
num=${#files[@]}
for ((i=0; i < $num; i++))
do
file=${files[i]}
tofile=`dirname ${curdir}`/${file}
cp -rf $file $tofile
done
}
bakdown