Last active
December 19, 2015 07:59
-
-
Save justnom/5922984 to your computer and use it in GitHub Desktop.
Dump and archive an SVN repo. Uses `svnrdump` which needs SVN server >= 1.7.x.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
:: Add in your url/paths | |
SET REPO_NAME=%1 | |
SET REPO_URL=%2 | |
SET REPO_DUMP_FILE=%REPO_NAME%.dump | |
SET REPO_DUMP_FILE_ARCHIVE=%date:~-4,4%%date:~-7,2%%date:~0,2%_%REPO_NAME%.7z | |
svnrdump dump -q %REPO_URL% > %REPO_DUMP_FILE% | |
IF %ERRORLEVEL% NEQ 0 GOTO :FAIL | |
7z a -t7z %REPO_DUMP_FILE_ARCHIVE% %REPO_DUMP_FILE% | |
IF %ERRORLEVEL% NEQ 0 GOTO :FAIL | |
del %REPO_DUMP_FILE% | |
EXIT /B 0 | |
:FAIL | |
echo Something went wrong! | |
EXIT /B 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment