2017-10-02 24 views
0

Ce script continue à me donner le code d'erreur 3 pour le robocopy mais fonctionne comme prévu. J'ai créé un fichier journal pour le capturer et il fonctionne très bien en ligne de commande et en script mais je reçois toujours une erreur sur My Build in TFS 2015. Des idées?Le script batch continue de donner le code d'erreur 3 même s'il fonctionne comme prévu

TFS construire erreur:

Exception Message: TF270015: 'RolltoDEV.bat' a renvoyé un code de sortie inattendu. Attendu "0"; réel '3'.

voici mon script:

@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 

Voici le fichier journal:

------------------ -------------------------------------------------- ----------- ROBOCOPY :: Copie de fichier robuste pour Windows


Commencé: lundi, 2 Octobre, 2017 11:04:27 Source: C: \ Builds \ 1004 \ PythonAutomation \ PythonAutomation - CD DEV \ src \ PythonAutomation \ Dest: D: \ drop \ PythonAutomation \ 1-DEV \ PythonAutomation - CD DEV \ PythonAutomation - CD DEV_20171002.23 \

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: \ Builds \ 1004 \ PythonAutomation \ PythonAutomation - CD DEV \ src \ PythonAutomation \ PythonAutomation \ Nouveau fichier 3 552 PythonAutomation.pyproj 0% 100% New Dir 0 C: \ Builds \ 1004 \ PythonAutomation \ PythonAutomation - CD DEV \ src \ PythonAutomation \ PythonAutomation \ BaseObjects \ New Dir
1 C: \ Builds \ 1004 \ PythonAutomation \ PythonAutomation - CD à DEV \ src \ PythonAutomation \ PythonAutomation \ Configuration \ Nouveau fichier 374 Config-Main.py 0% 100% Nouveau répertoire 0 C: \ Builds \ 1004 \ PythonAutomation \ PythonAutomation - CD à DEV \ src \ PythonAutomation \ PythonAutomation \ Configuration \ Propriétés \
New Dir 0 C: \ Builds \ 1004 \ PythonAutomation \ PythonAutomation - CD DEV \ src \ PythonAutomation \ PythonAutomation \ Configuration \ Propriétés \ PublishProfiles \ New Dir 1 C: \ Builds \ 1004 \ PythonAu tomation \ PythonAutomation - CD à DEV \ src \ PythonAutomation \ PythonAutomation \ Configuration \ Propriétés \ PublishProfiles \ RolltoDEV \ Nouveau fichier 520 RolltoDEV.bat 0% 100% Nouvelle Dir 0 C: \ Builds \ 1004 \ PythonAutomation \ PythonAutomation - CD à DEV \ src \ PythonAutomation \ PythonAutomation \ Propriétés \ New Dir
0 C: \ Builds \ 1004 \ PythonAutomation \ PythonAutomation - CD DEV \ src \ PythonAutomation \ PythonAutomation \ PythonAutomation \ New Dir 4 C: \ Builds \ 1004 \ PythonAutomation \ PythonAutomation - CD DEV \ src \ PythonAutomation \ PythonAutomation \ PythonAutomation \ BaseObjects \ Nouveau fichier 2664 Email.py 0% 100%
Nouveau fichier 573 File.py 0% 100%
Nouveau fichier 1260 SSHConnection.py 0% 100%
Nouveau fichier 342 initialisation .py 0% 100% New Dir 0 C: \ Builds \ 1004 \ PythonAutomation \ PythonAutomation - CD DEV \ src \ PythonAutomation \ PythonAutomation \ PythonAutomation \ Propriétés \ Nouveau dir 0 C: \ Builds \ 1004 \ PythonAutomation \ PythonAutomation - CD dEV \ src \ PythonAutomation \ PythonAutomation \ PythonAutomation \ Propriétés \ PublishProfiles \ New dir 3 C: \ Builds \ 1004 \ PythonAutomation \ PythonAutomation - CD dEV \ src \ PythonAutomation \ PythonAutomation \ PythonAutomation \ Propriétés \ PublishProfiles \ PublishProfiles \ Nouveau fichier 864 RolltoDEV.pubxml 0% 100%
Nouveau fichier 934 RolltoPROD.pubxml 0% 100%
Nouveau fichier 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 

Octets: 14,4 k 14,4 k 0 0 0 0
fois: 00:00:00 00:00:00 00h00: 00 0:00:00
Terminé: Lundi, Octobre 2, 2017 11:04:27 AM

------------------------ -------------------------------------------------- ----- ROBOCOPY :: Copie de fichier robuste pour Windows


Commencé: lundi, 2 Octobre, 2017 11:04:27 Source: C: \ Builds \ 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: \ Builds \ 1004 \ PythonAutomation \ PythonAutomation - CD DEV \ src \ PythonAutomation \ PythonAutomation \ Nouveau fichier 3552 PythonAutomation.pyproj 0% 100% New Dir 0 C: \ Builds \ 1004 \ PythonAutomation \ PythonAutomation - CD DEV \ src \ PythonAutomation \ PythonAutomation \ BaseObjects \ New Dir
1 C: \ Builds \ 1004 \ PythonAutomation \ PythonAutomation - CD DEV \ src \ PythonAutomation \ PythonAutomation \ Configuration \ nouveau fichier 374 Config-Main.py 0% 100% New Dir 0 C: \ Builds \ 1004 \ PythonAutomation \ PythonAutomation - CD DEV \ src \ PythonAutomation \ PythonAutomation \ Configuration \ Propriétés \
New Dir 0 C: \ Builds \ 1004 \ PythonAutomation \ PythonAutomation - CD DEV \ src \ PythonAutomation \ PythonAutomation \ Configuration \ Propriétés \ PublishProfiles \ New Dir 1 C: \ Établit \ 1004 \ PythonAutomation \ PythonAutomation - CD à DEV \ src \ PythonAutomation \ PythonAutomation \ Configuration \ Propriétés \ PublishProfiles \ RolltoDEV \ Nouveau fichier 520 RolltoDEV.bat 0% 100% Nouvelle Dir 0 C: \ Builds \ 1004 \ PythonAutomation \ PythonAutomation - CD à DEV \ src \ PythonAutomation \ PythonAutomation \ Propriétés \ New Dir
0 C: \ Builds \ 1004 \ PythonAutomation \ PythonAutomation - CD DEV \ src \ PythonAutomation \ PythonAutomation \ PythonAutomation \ New Dir 4 C: \ Builds \ 1004 \ PythonAutomation \ PythonAutomation - CD à DEV \ src \ PythonAutomation \ PythonAutomation \ PythonAutomation \ BaseObjects \ Nouveau fichier 2664 Email.py 0% 100%
Nouveau fichier 573 Fichier.py 0% 100%
Nouveau fichier 1260 SSHConnection.py 0% 100%
Nouveau fichier 342 initialisation .py 0% 100% New Dir 0 C: \ Builds \ 1004 \ PythonAutomation \ PythonAutomation - CD DEV \ src \ PythonAutomation \ PythonAutomation \ PythonAutomation \ Propriétés \ New Dir 0 C: \ Builds \ 1004 \ PythonAutomation \ PythonAutomation - CD dEV \ src \ PythonAutomation \ PythonAutomation \ PythonAutomation \ Propriétés \ PublishProfiles \ New Dir 3 C: \ Builds \ 1004 \ PythonAutomation \ PythonAutomation - CD à DEV \ src \ PythonAutomation \ PythonAutomation \ PythonAutomation \ Propriétés \ PublishProfiles \ PublishProfiles \ Nouveau fichier 864 RolltoDEV.pubxml 0% 100%
Nouveau fichier 934 RolltoPROD.pubxml 0% 100%
Nouveau fichier 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 

Octets: 14,4 k 14,4 k 0 0 0 0
temps: 0: 00:00 0:00:00 0:00:00 0:00:00

Vitesse: 1057500 octets/sec. Vitesse:
60,510 MegaBytes/min. Terminé: le lundi 2 Octobre, 2017 11:04:27

+2

Voir ce lien https://ss64.com/nt/robocopy-exit.html 0 × 03 3 (2 + 1) Certains fichiers ont été copiés. Des fichiers supplémentaires étaient présents. Aucune défaillance n'a été rencontrée. – RGuggisberg

+0

Merci pour l'aide! Voir ma réponse ci-dessous sur ce que j'ai fait avec cette information. @RGuggisberg – Pintang

Répondre

0

Pour tous ceux qui peuvent courir sur cette question, car l'erreur était pas vraiment une erreur dans le script batch, il travaillait encore, mais dans un TFS Le message d'erreur est un message d'erreur, donc il a échoué. Ce que j'ai fait pour résoudre ce problème consiste à contourner cette erreur spécifique dans mon script de traitement par lots en ajoutant le code suivant à la fin de mes instructions robocopy.

2>&1|find /v "TF270015" 

Espérons que cela aide quelqu'un dans le futur. Merci à @RGuggisburg de m'avoir montré le véritable message d'erreur derrière 3.

+1

Merci pour le partage, vous pourriez [Accepter comme une réponse] (https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work), Cela peut être bénéfique pour d'autres membres de la communauté lisant ce fil. –

+0

Fera merci! @ Andy-MSFT – Pintang