2008-03-13

Subversion リポジトリのバックアップ

手順

ミラーリポジトリの作成.

# cd /usr/local/share/backup/svn
# mkdir srv-svn
# svnadmin create srv-svn

フックの設定.

# cd srv-svn/hooks
# cp pre-revprop-change.tmpl pre-revprop-change
# cp start-commit.tmpl start-commit
# chmod +x pre-revprop-change start-commit
# vi pre-revprop-change
# vi start-commit
# cd ../..

pre-revprop-change

REPOS="$1"
REV="$2"
USER="$3"
PROPNAME="$4"
ACTION="$5"

if [ "$USER" = "backup" ]; then exit 0; fi

echo "Only the user 'backup' may change revision properties" >&2
exit 1
start-commit
REPOS="$1"
USER="$2"

if [ "$USER" = "backup" ]; then exit 0; fi

echo "Only the user 'backup' may commit new revisions" >&2
exit 1

ミラーリポジトリの初期化.

# svnsync init file:///usr/local/share/backup/svn/srv-svn \
      http://www.example.com/svn/ --usrename backup --password PASSWORD

ミラーの実行.

# svnsync sync srv-svn file:///usr/local/share/backup/svn/srv-svn \
      --usrename backup --password PASSWORD

0 件のコメント:

コメントを投稿