我希望使用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服务器崩溃了,那么如何通过镜像恢复生产svn回购呢?有可能吗?
有人能建议使用svnsync备份生产服务器的最佳实践吗?
发布于 2020-01-23 13:50:19
有几个选项比使用svnsync更好
https://stackoverflow.com/questions/34513002
复制相似问题