目的:能够自动完全备份svn库,并且生成相应的目录名。
实现方法:批处理命令+计划任务
具体命令如下:
@ECHO 自动备份:AT 23:00 /every:M,T,W,Th,F,S,Su c:/BackupSVN.bat
set mydate=%temp%/mydate.tmp
set mytime=%temp%/mytime.tmp
date /T > %mydate%
time /T > %mytime%
REM 忽略;开头的行,用-分隔,取1,2,3个符号
set parsearg="eol=; tokens=1,2,3* delims=-, "
for /F %parsearg% %%i in (%mydate%) do set yyyymmdd=%%i%%j%%k
set parsearg="eol=; tokens=1,2,3* delims=:, "
for /F %parsearg% %%p in (%mytime%) do set ppqq=%%p%%q
svnadmin hotcopy E:\IELab1302\SvnBase G:\EUoI\SvnBaseBackup%yyyymmdd%_%ppqq%
实现方法:批处理命令+计划任务
具体命令如下:
@ECHO 自动备份:AT 23:00 /every:M,T,W,Th,F,S,Su c:/BackupSVN.bat
set mydate=%temp%/mydate.tmp
set mytime=%temp%/mytime.tmp
date /T > %mydate%
time /T > %mytime%
REM 忽略;开头的行,用-分隔,取1,2,3个符号
set parsearg="eol=; tokens=1,2,3* delims=-, "
for /F %parsearg% %%i in (%mydate%) do set yyyymmdd=%%i%%j%%k
set parsearg="eol=; tokens=1,2,3* delims=:, "
for /F %parsearg% %%p in (%mytime%) do set ppqq=%%p%%q
svnadmin hotcopy E:\IELab1302\SvnBase G:\EUoI\SvnBaseBackup%yyyymmdd%_%ppqq%