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 を使用して運用サーバーをバックアップするベスト プラクティスを提案できますか?