Skip to content

Instantly share code, notes, and snippets.

@justnom
Last active December 19, 2015 07:59
Show Gist options
  • Save justnom/5922984 to your computer and use it in GitHub Desktop.
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.
@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