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.

 

posted on   johnphan  阅读(4159)  评论(0编辑  收藏  举报

编辑推荐:
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· 三行代码完成国际化适配,妙~啊~
· .NET Core 中如何实现缓存的预热?

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示