使用 svnsync 进行备份
use svnsync for backup
我想使用 svnsync
创建我的 svn 存储库的备份副本。
svnsync 命令复制所有版本控制的文件,以及它们的
服务员 svn 属性。它不复制钩子或 conf
来自源存储库的目录,所以我需要做这些
手动。
我已经编写了这个用于创建备份存储库的批处理脚本:
setlocal enableextensions enabledelayedexpansion
:: create local backup project
svnadmin create C:\Repositories\Test
:: initialize local backup project with remote project
svnsync initialize https://local.com/svn/Test https://remote.com/svn/Test
:: get remote info project and store in info.txt
svn info https://remote.com/svn/Test>info.txt
:: get remote UUID project from info.txt
set UUID=
for /f "delims=" %%a in (info.txt) do (
set line=%%a
if "x!line:~0,17!"=="xRepository UUID: " (
set UUID=!line:~17!
)
)
:: set local UUID project with the remote UUID project
svnadmin setuuid C:\Repositories\Test %UUID%
:: sync local and remote project
svnsync sync https://local.com/svn/Test https://remote.com/svn/Test
endlocal
我已经编写了这个批处理脚本来同步备份存储库与主存储库(每小时计划):
svnsync sync https://local.com/svn/Test https://remote.com/svn/Test
比如说,如果我通过 svnsync 设置一个镜像 svn 仓库,并且如果我的生产 svn
服务器崩溃了,那么我如何通过
镜子?可能吗?
有人可以建议使用 svnsync 备份生产服务器的最佳实践吗?
有几个选项比使用 svnsync
更好:
当您需要为 Subversion 存储库提供实时备份或 DR 服务器时,请考虑使用 Multisite Repository Replication (VDFS) feature. For the more detailed getting started guidance please consider the KB136: Getting started with Multisite Repository Replication and KB93: Performing disaster recovery for distributed VDFS repositories 文章部署副本(从属服务器)。
当您想要备份您的 Subversion 存储库时,请使用内置的 Backup and Restore feature. The Backup and Restore feature helps you make daily backups of the repositories of any size and does not have any impact on performance and user operations. What is more, the Backup and Restore feature in VisualSVN Server is very easy to setup and maintain. Please, read the article KB106: Getting Started with Backup and Restore 获取设置说明。
别忘了创建后台验证作业。见文章 KB115: Getting started with repository verification jobs.
我想使用 svnsync
创建我的 svn 存储库的备份副本。
svnsync 命令复制所有版本控制的文件,以及它们的 服务员 svn 属性。它不复制钩子或 conf 来自源存储库的目录,所以我需要做这些 手动。
我已经编写了这个用于创建备份存储库的批处理脚本:
setlocal enableextensions enabledelayedexpansion
:: create local backup project
svnadmin create C:\Repositories\Test
:: initialize local backup project with remote project
svnsync initialize https://local.com/svn/Test https://remote.com/svn/Test
:: get remote info project and store in info.txt
svn info https://remote.com/svn/Test>info.txt
:: get remote UUID project from info.txt
set UUID=
for /f "delims=" %%a in (info.txt) do (
set line=%%a
if "x!line:~0,17!"=="xRepository UUID: " (
set UUID=!line:~17!
)
)
:: set local UUID project with the remote UUID project
svnadmin setuuid C:\Repositories\Test %UUID%
:: sync local and remote project
svnsync sync https://local.com/svn/Test https://remote.com/svn/Test
endlocal
我已经编写了这个批处理脚本来同步备份存储库与主存储库(每小时计划):
svnsync sync https://local.com/svn/Test https://remote.com/svn/Test
比如说,如果我通过 svnsync 设置一个镜像 svn 仓库,并且如果我的生产 svn 服务器崩溃了,那么我如何通过 镜子?可能吗?
有人可以建议使用 svnsync 备份生产服务器的最佳实践吗?
有几个选项比使用 svnsync
更好:
当您需要为 Subversion 存储库提供实时备份或 DR 服务器时,请考虑使用 Multisite Repository Replication (VDFS) feature. For the more detailed getting started guidance please consider the KB136: Getting started with Multisite Repository Replication and KB93: Performing disaster recovery for distributed VDFS repositories 文章部署副本(从属服务器)。
当您想要备份您的 Subversion 存储库时,请使用内置的 Backup and Restore feature. The Backup and Restore feature helps you make daily backups of the repositories of any size and does not have any impact on performance and user operations. What is more, the Backup and Restore feature in VisualSVN Server is very easy to setup and maintain. Please, read the article KB106: Getting Started with Backup and Restore 获取设置说明。
别忘了创建后台验证作业。见文章 KB115: Getting started with repository verification jobs.