7
6

More than 5 years have passed since last update.

svnsyncでバックアップをとってみる

Last updated at Posted at 2016-02-17

今さらSubversionの話。
Subversionサーバのバックアップをsvn hotcopyで取っていたら容量不足に陥ったので、別の方法を探したところ svnsync を知ったので試してみた。

参考)
http://www.caldron.jp/~nabetaro/svn/svnbook-1.4-final/svn.ref.svnsync.c.init.html

ソースリポジトリ:バックアップ元にあるリポジトリ
ミラーリポジトリ:バックアップ先にあるリポジトリ

バックアップ先での準備

バックアップ先で以下を実施

・バックアップ用のミラーリポジトリを作る

svnadmin create /data/backup/svn/test_repos_bk

・pre-revprop-change hookを作成する

/data/backup/svn/test_repos_bk/hook/pre-revprop-change
内容は以下。
-
#!/bin/sh
exit 0
-

・初期化(このリポジトリのバックアップ元のソースリポジトリを指定するイメージかな)

svnsync init file:///data/backup/svn/test_repos_bk https://hogehoge/test_repos

バックアップ先で同期実行

バックアップ先で以下を実施

svnsync sync file:///data/backup/svn/test_repos_bk

※上記の通り、基本的にバックアップ先が主で使えるのがちょっと良い。

※この環境はバックアップ元への接続をHTTPS+LDAP認証にしているのでhttps://hogehogeにしている。
 環境によってsvnだったりsvn+sshだったりhttpだったり適宜読み替えよう。
  

7
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
6