2017-10-02 1 views
0

このスクリプトはrobocopyのエラーコード3を与え続けますが、意図したとおりに動作しています。私はそれをキャプチャするためのログファイルを作成し、それはコマンドラインとスクリプトでうまく動作しますが、私はまだTFS 2015のMy Buildでエラーが発生します。バッチスクリプトは、意図したとおりの作業であってもエラーコード3を与え続けます

TFSは、エラーを構築:

例外メッセージ:TF270015: 'RolltoDEV.batは' 予期せぬ 終了コードを返しました。期待される '0';実際の '3'。ここ

は私のスクリプトです:ここでは

@echo off 
set root="D:\Drop\PythonAutomation\1-DEV\PythonAutomation - CD to DEV" 
CD /D %root% 
FOR /F "delims=" %%i IN ('dir /b /ad-h /t:c /od') DO SET a=%%i 
CD /D C:\ 

robocopy "C:\Builds\1004\PythonAutomation\PythonAutomation - CD to DEV\src\PythonAutomation" "D:\Drop\PythonAutomation\1-DEV\PythonAutomation - CD to DEV\%a%" /E /log:D:\logFileForPython.txt 

robocopy "C:\Builds\1004\PythonAutomation\PythonAutomation - CD to DEV\src\PythonAutomation" "D:\PythonAutomation" /E /log+:D:\logFileForPython.txt 

は、ログファイルです:

------------------ -------------------------------------------------- ----------- ROBOCOPY :: Windows用ロバストファイルコピー


D:\ドロップ\ PythonAutomation \ -

開始:2017年10月2日(月曜日)11時04分27秒AM出典: Cは DEV \ SRC \ PythonAutomation \ destにCDを\はPythonAutomation \ PythonAutomation \ 1004 \ビルド1-DEV \ PythonAutomation - DEV \ PythonAutomationにCD - DEV_20171002.23 \にCD

Files : *.* 
    Options : *.* /S /E /DCOPY:DA /COPY:DAT /R:1000000 /W:30 

    3 C:\Builds\1004\PythonAutomation\PythonAutomation - CD to DEV\src\PythonAutomation\ *EXTRA Dir  -1 D:\Drop\PythonAutomation\1-DEV\PythonAutomation - CD to DEV\PythonAutomation - CD to DEV_20171002.23\logs\ 
    New File   1324 PythonAutomation.log 0% 100% 
    New File   1255 PythonAutomation.sln 0% 100% 
    New File    221 PythonAutomation.sln.Any CPU.Debug.vsprops 0% 100%  New Dir   

1 C:\ 1004 \ PythonAutomation \ PythonAutomation \ビルド - CD DEV \ SRC \へPythonAutomation \ PythonAutomation \ 新しいファイル3 PythonAutomation \ PythonAutomation \ PythonAutomation \ PythonAutomation \ PythonAutomation \ BaseObjects \ NewDir
1 C:\ Builds \ 1004 \ PythonAutomation \ PythonAutomation - CDに DEV \ src \ PythonAutomation \ PythonAutomation \ Configuration \ 新しいファイル374 Config-Main.py 0%100%新しいディレクトリC:\ Builds \ 1004 \ PythonAutomation \ PythonAutomation - CDに DEV \ src \ PythonAutomation \ PythonAutomation \構成\プロパティ\
新監督0 C:\ 1004 \ PythonAutomation \ PythonAutomation \ビルド - DEV \ SRC \ PythonAutomation \ PythonAutomation \構成\プロパティ\ PublishProfiles \ 新監督1個のCへ CD:\ 1004 \ビルド\ PythonAu tomo \ PythonAutomation - CDからDEV \ src \ PythonAutomation \ PythonAutomation \ Configuration \ Properties \ PublishProfiles \ RolltoDEV \ 新しいファイル520 RolltoDEV.bat 0%100%新しいディレクトリ0 C:\ Builds \ 1004 \ PythonAutomation \ PythonAutomation - DEV \ SRC \ PythonAutomation \ PythonAutomation \プロパティ\新監督
0 C:\ 1004 \ PythonAutomation \ PythonAutomation \ビルド - DEV \ SRC \ PythonAutomation \ PythonAutomation \ PythonAutomation \新監督 4 C にCD:\ 1004 \ビルド\はPythonAutomation \ PythonAutomation - DEVにCD \ SRC \ PythonAutomation \ PythonAutomation \ PythonAutomation \ BaseObjects \ 新規ファイル2664 Email.py 0%、100%
新規ファイル573 File.py 0%100%
新しいファイル1260 SSH接続。PY 0%100%
新規ファイル342 のinitの.py 0%100%新監督0 C:\ 1004 \ \ PythonAutomation \ PythonAutomationビルド - CD DEVに\ SRC \ PythonAutomation \ PythonAutomation \ PythonAutomation \プロパティ\ 新Dir 0 C:\ Builds \ 1004 \ PythonAutomation \ PythonAutomation - CDからDEV \ src \ PythonAutomation \ PythonAutomation \ PythonAutomation \ Properties \ PublishProfiles \ 新しいディレクトリ3 C:\ Builds \ 1004 \ PythonAutomation \ PythonAutomation - CDからDEV \ src \ PythonAutomation \ PythonAutomation \ PythonAutomation \ Properties \ PublishProfiles \ PublishProfiles \ 新しいファイル864 RolltoDEV.pubxml 0%100%
新しいファイル934 RolltoPROD.pubxml 0%100%
新規ファイル922 RolltoQA.pubxml 0%100%


  Total Copied Skipped Mismatch FAILED Extras 
Dirs :  13  12   0   0   0   1 Files :  13  13   0   0   0   0 

バイト:14.4 K 14.4 K 0 0 0 0
タイムズ:夜12時00分00秒夜12時00分00秒午後12時00分: 00 0:00:00
終了日:2017年10月2日11:04:27 AM

------------------------ -------------------------------------------------- ----- ROBOCOPY :: Windows用ロバストファイルコピー


が開始:2017年10月2日(月曜日)11時04分27秒AM出典: C:\ 1004 \ \ PythonAutomation \ PythonAutomationビルド - CD DEVに\ SRC \ PythonAutomation \ Destは:D:\ PythonAutomation

\
Files : *.* 
    Options : *.* /S /E /DCOPY:DA /COPY:DAT /R:1000000 /W:30 

    3 C:\Builds\1004\PythonAutomation\PythonAutomation - CD to DEV\src\PythonAutomation\ *EXTRA Dir  -1 D:\PythonAutomation\.vs\ *EXTRA Dir  -1 D:\PythonAutomation\Outputs\ 
    New File   1324 PythonAutomation.log 0% 100% 
    New File   1255 PythonAutomation.sln 0% 100% 
    New File    221 PythonAutomation.sln.Any CPU.Debug.vsprops 0% 100%  New Dir   

1個のC:\ 1004 \ PythonAutomation \ PythonAutomation \ビルド - DEV \ SRC \ PythonAutomation \ PythonAutomation \ 新しいファイルにCD 3552 PythonAutomation.pyproj 0%、100%の新監督0 C:\ 1004 \ PythonAutomation \ PythonAutomation \ビルド - DEVのCD \ SRC \ PythonAutomation \ PythonAutomation \ BaseObjects \新監督
1 C:\ 1004 \ PythonAutomation \ PythonAutomation \ビルド - DEV \ SRC \ PythonAutomation \にCD PythonAutomation \ Configuration \ 新しいファイル374 Config-Main.py 0%100%New Dir 0 C:\ Builds \ 1004 \ PythonAutomation \ PythonAutomation - CD DEV \ src \ PythonAutomation \ PythonAutomation \ Configuration \ Properties \
新しいディレクトリ0 C:\ Builds \ 1004 \ PythonAutomation \ PythonAutomation - CDから にDEV \ src \ PythonAutomation \ PythonAutomation \ Configuration \ Properties \ PublishProfiles \ 新しいディレクトリ1:\ビルド\ 1004 \ PythonAutomation \ PythonAutomation新しいファイル520 RolltoDEV.bat 0%100%New Dir 0 C:\ Builds \ 1004 \ PythonAutomation \ PythonAutomation - CDを にダウンロードするDEV \ src \ PythonAutomation \ PythonAutomation \ Configuration \ Properties \ PublishProfiles \ RolltoDEV \ SRC \ PythonAutomation \ PythonAutomation \プロパティ\新監督
0 C:\ 1004 \ PythonAutomation \ PythonAutomation \ビルド - CD にDEV \ SRC \ PythonAutomation \ PythonAutomation \ PythonAutomation \新監督 は4 C:\ 1004 \ビルド\ PythonAutomation \ PythonAutomation - CDに DEV \ src \ PythonAutomation \ PythonAutomation \ PythonAutomation \ BaseObjects \ 新しいファイル2664 Email.py 0%100%
新しいファイル573ファイル。PY 0%100%
新規ファイル1260 SSHConnection.py 0%100%
新規ファイル342 のinitの.py 0%100%新監督0 C:\ 1004 \ PythonAutomation \ PythonAutomation \ビルド - DEVにCD \ SRC \ PythonAutomation \ PythonAutomation \ PythonAutomation \プロパティは、\ 新監督0 C:\ 1004 \ PythonAutomation \ PythonAutomation \ビルド - DEVにCD \ SRC \ PythonAutomation \ PythonAutomation \ PythonAutomation \プロパティ\ PublishProfiles \ 新監督3 C:\ビルド\ 1004 \ PythonAutomation \ PythonAutomation - CDからDEV \ src \ PythonAutomation \ PythonAutomation \ PythonAutomation \ Properties \ PublishProfiles \ PublishProfiles \ 新しいファイル864 RolltoDEV.pubxml 0%100%
新規ファイル934 RolltoPROD.pubxml 0%100%
新規ファイル922 RolltoQA.pubxml 0%100%


  Total Copied Skipped Mismatch FAILED Extras 
Dirs :  13  12   0   0   0   2 Files :  13  13   0   0   0   0 

バイト:14.4 K 14.4 K 0 0 0 0
時間:0: 00:00 0:00:00 0:00:00 0:00:00

速度:1057500バイト/秒。速度:
60.510メガバイト/分終了した:2017年10月2日(月曜日)11時04分27秒AM

+2

このリンクを参照してください。https://ss64.com/nt/robocopy-exit.html 0×03 3(2 + 1)一部のファイルがコピーされました。追加ファイルが存在しました。失敗はなかった。 – RGuggisberg

+0

助けてくれてありがとう!この情報で私が何をしたのか、私の答えを見てください。 @RGuggisberg – Pintang

答えて

0

を、この問題に遭遇することがあり、誰のために、エラーが実際にそれがまだ働いていたバッチスクリプトではなく、TFSにおける誤りはなかったので、エラーメッセージはエラーメッセージで、失敗しました。私がこの問題を解決するためにしたのは、robocopyステートメントの最後に次のコードを追加することで、バッチスクリプトでこの特定のエラーを回避することです。

2>&1|find /v "TF270015" 

これは将来誰かに役立つことを望みます。私に実際のエラーメッセージ3を表示してくれた@RGuggisburgのおかげです。

+1

共有してくれてありがとうございます。[回答として受け入れる](https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work)これはこのスレッドを読む他のコミュニティメンバー –

+0

ありがとう! @アンディー - MSFT – Pintang

関連する問題