VSS自动备份脚本

 

1。备份脚本

 

ECHO ====================== 开始 ========================

SET VSS_INSTALL_PATH=D:/VSS/
SET VSS_DB=E:/VSS/
SET BACKUP_FILE="e:/VSSBackup/%DATE%_%TIME%_Backup.ssa"
SET VSS_ADMIN_NAME=admin
SET VSS_ADMIN_PASSWORD=xxxx

FOR /F "tokens=1-3 delims=- " %%i IN ('date /t') DO SET DATE=%%i-%%j-%%k
FOR /F "tokens=1-2 delims=: " %%i IN ('time /t') DO SET TIME=%%i_%%j

%VSS_INSTALL_PATH%"ssarc.exe" -d- -i- -y%VSS_ADMIN_NAME%,%VSS_ADMIN_PASSWORD% -s%VSS_DB% %BACKUP_FILE% $/

if errorlevel 1 (
 ECHO 备份失败
) else (
 ECHO 备份成功
)

ECHO ====================== 结束 ========================

2。计划任务设置脚本

 @ECHO OFF
@TITLE VSS自动备份任务设置

schtasks /create /RU system /SC DAILY /ST 12:00:00 /TN "VSS自动备份任务" /TR "cmd /c d:/vss/backup.bat >> d:/VSS/backup.log"

使用>>符号可以将每次备份的日志都记录到后面的日志文件中。

3。参考资料 

 

http://blog.csdn.net/downmoon/archive/2006/08/21/1102679.aspx
 
VSS的每日自动备份
http://www.cnblogs.com/heekui/archive/2007/01/25/629972.aspx

 

sourceSafe每天自动备份及修复(适用于vss6.0vss2005)
@ECHO OFF
@TITLE VSS自动备份

你可能感兴趣的:(Date,脚本,File,Path,任务,vss)