【问题标题】:Visual SourceSafe Command LineVisual SourceSafe 命令行
【发布时间】:2011-12-14 08:41:29
【问题描述】:

我正在使用以下脚本从命令行对计划任务运行源代码安全,以每天备份所有项目和文件。该脚本运行正常,但每次总是跳过 4 个文件夹 - 相同的 4 个文件夹。

我搜索了很多,我试图修改代码,但同样的事情。有谁知道可能是什么问题?

这是脚本:

@echo off


FOR /F "tokens=2-4 delims=/ " %%i IN ('date /t') DO SET DATE=%%j-%%i-%%k


SET ssuser=admin
SET sspass=**********
SET ssdir=\\10.1.43.106\DewanWork
SET ssbakd=\\10.1.43.42\SSBackup\%DATE%
SET ssmail=
SET smtp=

FOR /F "tokens=1 delims=" %%t in ('CD') DO @SET thisDir=%%t

REM --------------------------------------------------------
REM Start outputting to log
REM --------------------------------------------------------

@ss Workfold $/ %ssbakd% -Y%ssuser%,%sspass% -Oworkfold.txt
FOR /F "delims= " %%e IN ('TYPE workfold.txt') DO IF "%%e"=="Invalid" GOTO                             WorkFoldError
DEL /Q workfold.txt

REM --------------------------------------------------------
REM Get latest versions of all project files recursively
REM ----------------------------------`enter code here`----------------------
@ss Get $/* -R -I-Y -Y%ssuser%,%sspass% -Oget.txt
FOR /F "delims= " %%e IN ('TYPE get.txt') DO IF "%%e"=="Invalid" GOTO GetError
DEL /Q get.txt

@echo "" >> "sourcesafe_%DATE%_log.txt"
DIR %ssbakd% | FIND "Dir(s)" >> "sourcesafe_%DATE%_log.txt"
@echo %time% - Finished sourcesafe backup >> "sourcesafe_%DATE%_log.txt"
GOTO FinishUp

:WorkFoldError
@echo Error occured while setting working folder: >> "sourcesafe_%DATE%_log.txt"
TYPE workfold.txt >> "sourcesafe_%DATE%_log.txt"
DEL /Q workfold.txt
GOTO SendMail

:GetError
@echo Error occured while getting project files: >> "sourcesafe_%DATE%_log.txt"
TYPE get.txt >> "sourcesafe_%DATE%_log.txt"
DEL /Q get.txt

:SendMail
IF "%ssmail%"=="" GOTO FinishUp
IF "%smtp%"=="" GOTO FinishUp


:FinishUp
@echo %time%: Finished backup
@echo on

谢谢。

【问题讨论】:

    标签: windows command-line dos visual-sourcesafe


    【解决方案1】:

    您是否检查过脚本跳过的文件夹(以及文件夹中的文件)的权限?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-11-01
      • 2018-11-08
      • 2010-09-24
      • 2020-04-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多