本文字档仍在编写中,内容可能会发生很大变化,可能无法准确描述 Apache™ Subversion® 软件的任何已发布版本。将此页面添加书签或将其推荐给其他人可能不是明智之举。请访问 https://svnbook.subversion.org.cn/ 获取本书的稳定版本。
svnadmin recover — 将仓库数据库恢复到一致状态(仅适用于使用 bdb
后端的仓库)。此外,如果 repos/conf/passwd
不存在,它将创建一个默认的密码文件。
svnadmin recover REPOS_PATH
恢复卡住的仓库
$ 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.
恢复数据库需要对仓库进行独占锁定。(这是一个 “数据库锁定”;请参见侧边栏 “锁定”的多种含义。)如果另一个进程正在访问仓库,则 svnadmin recover 会报错
$ svnadmin recover /var/svn/repos svn: E165000: Failed to get exclusive repository access; perhaps another proce ss 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.