名前

svnadmin recover — リポジトリデータベースの一貫した状態への復帰。 (bdbバックエンドを使っているリポジトリの場合だけです)。 さらにrepos/conf/passwdが存在しなければデフォルトの パスワードファイルも作ります。

用法

svnadmin recover REPOS_PATH

説明

リポジトリは修復される必要があるというエラーメッセージを受け取った ときにはこのコマンドを実行してください。

スイッチ

--wait

ハングしてしまったリポジトリの修復:

$ svnadmin recover /usr/local/svn/repos/ 
Repository lock acquired.
Please wait; recovering the repository may take some time...

Recovery completed.
The latest repos revision is 34.

データベースの修復にはリポジトリを排他的にロックする必要があります。他 のプロセスがリポジトリにアクセスしている場合、svnadmin recoverはエラーになります:

$ svnadmin recover /usr/local/svn/repos
svn: Failed to get exclusive repository access; perhaps another process
such as httpd, svnserve or svn has it open?

$

しかし --waitオプションを指定すると svnadmin recoverは他のプロセスの接続が切れるまで待ちつづけます:

$ svnadmin recover /usr/local/svn/repos --wait
Waiting on repository lock; perhaps another process has it open?

### time goes by...

Repository lock acquired.
Please wait; recovering the repository may take some time...

Recovery completed.
The latest repos revision is 34.