SVNBAK.bat
echo off
rem Subversion的安装目录
set SVN_HOME="C:\Program Files\VisualSVN Server"
rem 所有版本库的父目录
set SVN_ROOT=D:\SvnRepositories
rem 备份的目录
set BACKUP_SVN_ROOT=D:\数据备份\svn
set BACKUP_DIRECTORY=%BACKUP_SVN_ROOT%\%date:0,10%
if exist %BACKUP_DIRECTORY% goto checkBack
echo 建立备份目录%BACKUP_DIRECTORY%>>%SVN_ROOT%/backup.log
mkdir %BACKUP_DIRECTORY%
rem 验证目录是否为版本库,如果是则取出名称备份
for /r %SVN_ROOT% %%I in (.) do @if exist "%%I\conf\svnserve.conf" svnbak_one.bat "%%~fI" %%~nI
goto end
:checkBack
echo 备份目录%BACKUP_DIRECTORY%已经存在,请清空.
goto end
:end
SVNBAKONE.bat
@echo 正在备份版本库%1.
@%SVN_HOME%\bin\svnadmin hotcopy %1 %BACKUP_DIRECTORY%\%2
@echo 版本库%1成功备份到了%2!
vssbak.bat
@ECHO OFF
@TITLE Backing up source safe databases
SET VSS_Install_Path="C:\Program Files\vss\win32\ssarc.exe"
SET VSS_DB="\\10.136.238.73\vss"
SET Bak_File="d:\VSS_%DATE%_Backup.ssa"
SET VSS_Admin_Name="admin"
SET VSS_Admin_Password="std228141"
FOR /F "tokens=1-3 delims=- " %%i IN ('date /t') DO SET DATE=%%i-%%j-%%k
%VSS_Install_Path% -d- -y%VSS_Admin_Name%,%VSS_Admin_Password% -s%VSS_DB% %Bak_File% $/
@ECHO Finished backups
本脚本从网上收集,在此作个备份.
1.vssbak.bat是vss的全备份脚本.
2.svnbak.bat是svn的全备份脚本,请注意脚本中的几个路径,svnbak_one.bat被svnbak.bat调用和.
标签:slik,svn,受限