本手册编写用于描述 Subversion 1.2。如果您运行的是较新版本的 Subversion,我们强烈建议您访问 https://svnbook.subversion.org.cn/ 并查阅适合您 Subversion 版本的本手册。
svnadmin recover — 将仓库数据库恢复到一致状态(仅适用于使用 bdb
后端的仓库)。此外,如果 repos/conf/passwd
不存在,它将创建一个默认密码文件。
恢复挂起的仓库
$ 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.