svn库迁移脚本

时间:2021-02-25 19:35:49

#! /bin/bash

#svn库迁移,为了提高速度,将原svn库目录挂载到当前现svn库服务器上

#版本:V1.0

#Date:2016-10-19

#author:salt

#email:zwj92087@163.com


DUMP_PATH='/mnt/250/'
LOAD_PATH='/usr/local/csvn/data/repositories/'
REPOS_NAME=(cms_wd_rebuild gopep it-infra new_group test.gopep.cn banjizuoye Chromium_dtbrowser dianliang e-campus \
gopep_app platform testing bit cms_1_php dib erp gopep-houtai rhinos www_dtedu_com  cms_jw2014 dt-cms exam_generate \
GopepV2.0 scm bluefin cms_public dtedu exam.gopep.cn group lw_paper sso center cms_wd_nr_ora_2014 dtops exam_temp \
svn_test ceping cms_wd_nr_src ebookbase frontproject MobileApp tablet)
#REPOS_NAME=(asaf)


for(( i=0;i<${#REPOS_NAME[@]};i++))
do
    DUMP_CURRENT=`cat $DUMP_PATH${REPOS_NAME[i]}/db/current`
    LOAD_CURRENT=`cat $LOAD_PATH${REPOS_NAME[i]}/db/current`
    SUCCESS='/usr/local/csvn/data/repositories/success.txt'
    FAIL='/usr/local/csvn/data/repositories/fail.txt'    


    /usr/local/csvn/bin/svnadmin dump $DUMP_PATH${REPOS_NAME[i]} | /usr/local/csvn/bin/svnadmin load $LOAD_PATH${REPOS_NAME[i]}
    if [ $DUMP_CURRENT==$LOAD_CURRENT ]
    then
        echo "${REPOS_NAME[i]} " >> $SUCCESS
    else
        echo "${REPOS_NAME[i]} " >> $fail
    fi
done