The following batch script runs on a Scheduled Task on Windows 7 with a quad core 2.5GHz and 16GB of DDR3.
It makes the svn server unavailable for about 10 minutes, so it can produce a 500MB file, and this is only increasing.
How can I speed this up?
@echo off
mode con cols=33 lines=3 >nul
color 1F
if "%1"=="done" goto runtime
start "" /min %0 done
exit
:runtime
title Backing up SVN
echo.
echo.
echo Backing up SVN... do NOT close!
for /f "tokens=1-4 delims=/ " %%a in ('date /t') do (set bdate=%%c-%%b-%%a)
for /f "tokens=1-2 delims=/:" %%a in ('time /t') do (set btime=%%a-%%b)
cd %temp%
rd /s /q svnbackup >nul 2>&1
md svnbackup
cd svnbackup
md certs
md conf
md uncommitted_db-pc
cd uncommitted_db-pc
net stop VisualSVNServer >nul 2>&1
svn status C:\SVN-EDGE>files.txt
for /F "tokens=1*" %%T in ('svn status C:\SVN-EDGE') do xcopy "%%U" ".\%%~pU" /F /H /K /X /Y /R /Q >nul 2>&1
svn status C:\INTERNAL>>files.txt
for /F "tokens=1*" %%T in ('svn status C:\INTERNAL') do xcopy "%%U" ".\%%~pU" /F /H /K /X /Y /R /Q >nul 2>&1
svn status C:\RESTRICTED>>files.txt
for /F "tokens=1*" %%T in ('svn status C:\RESTRICTED') do xcopy "%%U" ".\%%~pU" /F /H /K /X /Y /R /Q >nul 2>&1
cd ..
"%ProgramFiles%\7-Zip\7z.exe" a -mx9 uncommitted_files.7z uncommitted_db-pc\* >nul 2>&1
rd /s /q uncommitted_db-pc >nul 2>&1
svnadmin dump --deltas --quiet S:/Customers > Customers.dump
svnadmin dump --deltas --quiet S:/Internal > Internal.dump
svnadmin dump --deltas --quiet S:/Restricted > Restricted.dump
net start VisualSVNServer >nul 2>&1
for %%I in (S:\authz S:\authz-windows S:\htpasswd C:\INTERNAL\SVN\Backup.bat) do copy %%I . >nul
copy "%VISUALSVN_SERVER%\certs\*" certs >nul
copy "%VISUALSVN_SERVER%\conf\*" conf >nul
"%ProgramFiles%\7-Zip\7z.exe" a -mx9 %bdate%_%btime%.7z * >nul 2>&1
move 2*.7z C:\Users\DB\Dropbox\Backups\SVN >nul
cd ..
rd /s /q svnbackup >nul 2>&1
exit
echo
commands... There's not a lot you can do to increase the speed of a batch file. \$\endgroup\$svn hotcopy
, but I think it'd involve rewriting the majority of the script, and I don't know whether it would result in a speed increase? Related SO question: stackoverflow.com/q/33055/1563422 \$\endgroup\$