从多个文件恢复 SVN 备份 [英] Restore SVN backups from multiple files
问题描述
我有一个非常大(~6GB)的 SVN 存储库,为此我编写了一个批处理文件脚本来每天进行增量备份.该脚本会检查上次备份的运行时间,并仅转储此后的修订.
I have a very large (~6GB) SVN repository, for which I've written a batch file script to do an incremental backup each day. The script checks when the last backup was run and dumps only the revisions since then.
文件命名为:backup-{lower_revision}-{higher_revision}.svn
例如:backup-156-162.svn
、backup-163-170.svn
.
The files are named: backup-{lower_revision}-{higher_revision}.svn
eg: backup-156-162.svn
, backup-163-170.svn
.
这意味着我有很多小的转储文件,我想这很好(比很多 6GB 转储文件要好),但我有点担心从中恢复需要多少工作我应该需要这些备份.
This means that I have quite a lot of small dump files, which I guess is fine (better than a lot of 6GB dump files), but I'm a little bit worried about how much work it would be to restore from these backups should I need to.
为了减少文件总数,我已经在每个月的第一天进行了一次完整的转储,但是,如果我需要在 30 日恢复,那将是 30 个转储文件,这可能需要一段时间.
To reduce the total number of files, I've taken to doing a full dump on the first of each month, but still, should I need to restore on the 30th, that's gonna be 30 dump files which could take a while.
我一直在考虑的是:
- 手册:
svnadmin load c:\myRepo <backup-1-10.svn
等待svnadmin load c:\myRepo <backup-11-24.svn
等待
等等... - 批处理文件使上述过程不那么乏味
- 将每个文件附加在一起并进行一次加载(如果可能的话?)
处理这些文件的最佳方式是什么,我是否需要恢复?
What would be the best way to work with these files, should I need to restore?
ps:操作系统是 Windows
推荐答案
您应该仅通过编号 [01, 02,..31] 来重命名您的文件,以便您的文件可以轻松排序对于转储,知道里面有哪些修订并不重要.
You should rename your files just by numbering the day [01, 02,..31] so your files can easily be sorted For the dump it is not important to know which revisions are inside.
我采用了不同的方法,因为像这样加载一个巨大的 Repo 需要一些时间,所以你应该考虑以下几点:
您可以使用 svnadmin hotcopy 每周/每月热复制存储库.每天您都应该进行增量转储以获取最新修订版,以便检索您只需调用的最新修订版
svnlook youngest [live_repo] -> 为您提供实时存储库的最新版本
I follow a different approach, because loading back a huge Repo like this takes some time, so you should consider the following:
You can use svnadmin hotcopy for hotcopying the repository every week/every month.
Each day you should make an incremental dump for getting the latest revisions for retrieving the latest revisions you just have to call
svnlook youngest [live_repo] -> gives you your most current revision of your live repository
svnlook youngest [copied_repo] -> 为您提供每周热拷贝备份的最新修订版
svnlook youngest [copied_repo] -> gives you the last revision you backed up by weekly hotcopy
现在您可以使用两个修订号从实时存储库中运行转储.
优点:
now you can run a dump from from your live-repo using both revisions numbers.
Advantages:
- 让您的备份存储库重新启动和运行要快得多(转储需要数小时!)
- 减少转储文件
- 减少脚本编写工作
- 可通过 post-commit-hook 扩展到per-commit"-backups,因此您将不会丢失任何修订
这篇关于从多个文件恢复 SVN 备份的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!