名称

svnadmin recover — Bring a repository database back into a consistent state (applies only to repositories using the bdb backend). In addition, if repos/conf/passwd does not exist, it will create a default passwordfile .

概要

svnadmin recover REPOS_PATH

描述

在你得到的错误说明你需要恢复版本库时运行这个命令。

选项

--wait

例子

恢复挂起的版本库:

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

Recovery completed.
The latest repos revision is 34.

Recovering the database requires an exclusive lock on the repository. (This is a database lock; see the sidebar 锁定的三种含义.) If another process is accessing the repository, then svnadmin recover will error:

$ svnadmin recover /var/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 /var/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.