Skip to content

Instantly share code, notes, and snippets.

@justnom
Last active December 18, 2015 02:59
Show Gist options
  • Save justnom/5714870 to your computer and use it in GitHub Desktop.
Save justnom/5714870 to your computer and use it in GitHub Desktop.
Dump and compress a remote SVN repository. For SVN servers with version < 1.7.
:: Add in your url/paths
SET REPO_URL=svn://mysvnhost.com/repo/
SET REPO_PATH=D:\repo_backup\
SET REPO_DUMP_FILE=D:\repo_backup.dump
SET REPO_DUMP_FILE_ARCHIVE=%date:~-4,4%%date:~-7,2%%date:~0,2%dump.7z
SET REPO_PATH_NUX=file:///D:/repo_backup/
del %REPO_DUMP_FILE%
rmdir %REPO_PATH% /s/q
mkdir %REPO_PATH%
svnadmin create %REPO_PATH%
echo > %REPO_PATH%\hooks\pre-revprop-change.cmd
svnsync init %REPO_PATH_NUX% %REPO_URL%
svnsync sync %REPO_PATH_NUX%
svnadmin dump %REPO_PATH% > %REPO_DUMP_FILE%
7z a -t7z %REPO_DUMP_FILE_ARCHIVE% %REPO_DUMP_FILE%
del %REPO_DUMP_FILE%
rmdir %REPO_PATH% /s/q
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment