1

我想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 repo,并且如果我的生产 svn 服务器崩溃了,那么我如何通过镜像恢复生产 svn repo?可能吗?

有人可以建议使用 svnsync 备份生产服务器的最佳实践吗?

4

1 回答 1

1

有几个选项比使用更好svnsync

于 2020-01-23T13:50:19.690 回答