Subversion(SVN)備份問題(用 svnadmin hotcopy 支持增量備份)


 SVN備份方法:

  • 直接備份SVN的Pepositories文件,應該是最不好的方法,需要停止Subversion服務。不然,可能出問題。
  • 用命令svnadmin Dump&Load備份的方法,只能備份數據部分,無法備份SVN的權限設置、hook腳本等數據。但可以選擇備份數據庫的一部分數據,也實現可增量備份。
  • 備份SVN 的最好方法,是用 svnadmin hotcopy 備份的方法,第一次要全部備份(耗時巨長);以后的每次備份,用 svnadmin hotcopy --incremental 選項,每次增量備份,速度飛快。

但是,svnadmin hotcopy 這種備份方法無法備份 SVN 或 VisualSVN 的配置數據,包括:用戶信息、分組分組、用戶權限分配、用戶設置的密碼,這幾個文件還是手工備份一下吧!

注意:這個增量備份的選項,僅僅在庫文件是 FSFS 格式才可用。當然,一般SVN都是用這種格式

參考資料:

查看已經創建的svn庫是 FSFS 還是 VDFS 的

網絡(中文)上許多地方都說 svnadmin hotcopy 不能增量備份!

查看Subversion的升級日志,早在2013年 svnadmin hotcopy 就支持增量備份了。

日志摘錄:

 Version 1.8.0

(18 Jun 2013, from /branches/1.8.x)
* new 'svnadmin hotcopy --incremental' support for FSFS (issue #3815)

https://svn.apache.org/repos/asf/subversion/trunk/CHANGES

 

網絡上有資料說,每次增量備份可以是這樣:

svnadmin verify %repopath%

svnadmin pack %repopath%

svnadmin hotcopy %repopath% %backupdir% --incremental

網摘一段參考文字:http://subversion.apache.org/docs/release-notes/1.8.html#incremental-hotcopy

the svnadmin hotcopy command now supports incremental operation, triggered by the new --incremental option.

In prior releases of Subversion, svnadmin hotcopy refused to copy over an existing destination repository, and always copied the entire repository. For large repositories, performing a hotcopy could take several hours, preventing an efficient backup process.

In incremental hotcopy mode, revision data which has already been copied from the source to the destination repository will not be copied again. svnadmin hotcopy --incremental will only copy new revisions, and revisions which have changed in size or had their modification time stamp changed since the previous hotcopy operation.

Up to now, svnsync or svnadmin dump --incremental were the only alternatives for incremental repository backup. However, these commands need to perform additional processing while transforming revision data into an intermediate format before creating revision files in the destination repository. Performance of svnadmin hotcopy is only limited by disk I/O.

Incremental hotcopy is not supported for BDB repositories. See issue 4081 for more information.

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM