版本库备份

无论你使用何种版本库,定期维护和验证版本库备份非常重要,或许你可以访问最近版本的文件,但是如果没有版本库,所有的历史将会丢失。

最简单(但不推荐)的方法是复制整个版本库目录到备份介质,然而你必须绝对确定没有访问数据的进程,在这里“访问”的意思是任何访问,一个BDB版本库即使在访问看起来只需要读时也会有写操作,如果在复制时版本库被访问了(web浏览器,WebSVN等等),备份将毫无价值。

推荐的方法是运行

svnadmin hotcopy path/to/repository path/to/backup --clean-logs

,用一种安全的方式创建版本库的备份,备份是一个副本,--clean-logs选项并不必须,但是通过删除BDB版本库中多余的日志文件可以节省一些空间。

The svnadmin tool is installed automatically when you install the Subversion command line client. If you are installing the command line tools on a Windows PC, the best way is to download the Windows installer version. It is compressed more efficiently than the .zip version, so the download is smaller, and it takes care of setting the paths for you. You can download the latest version of the Subversion command line client from http://subversion.apache.org/getting.html.