We have an application that handles data transfer to a cloud and to a local server location. We use Robocopy for the local transfer as such:
`ROBOCOPY.EXE "%SRC%" "%DEST%" /S /V /FP /IS /Z /R:5 /W:5 /ETA /LOG+:%NETDRIVE%\log\robolog.txt"
Our app monitors the robocopy output. If transfers fail or do not complete they are repeated.
We did a test, where the network was pysically disconnected during the transfer with following output.
Robocopy Header as expected
-----
1 SOURCE_DIR. // The 1 indicate there is one file in the source dir
ERROR 53 (0x00000035) Accessing Destination Directory DEST_DIR
The network path was not found. // This repeats five times as expected with the option /R:5
ERROR: RETRY LIMIT EXCEEDED.
Total Copied Skipped Mismatch FAILED Extras
Dirs : 1 0 1 0 0 0
Files : 0 0 0 0 0 0
Bytes : 0 0 0 0 0 0
Times : 0:00:27 0:00:00 0:00:25 0:00:02
Ended : DATE
The return code is 0. " No errors occurred, and no copying was done. The source and destination directory trees are completely synchronized." Ref for return codes
This makes no sense to me and I cannot reproduce it in any way.
- If
SOURCE_DIRis empty, the first line after the header indicates 0 - IF
DEST_DIRcannot be reached and throws an error, 0 should not be the return code. - Since there must be a file in
SOURCE_DIR(indicated by the 1), not all columns in theFILESrow of the summary should be 0. THe file should "be" somewhere. ERROR 53(DESTnot reachable)RETRY LIMIT EXCEEDEDare errors. After errors there is no summary.
2 Questions:
- What constellation can result in this incoherent output and return code.
- If returning 0 is possible when network not is not reachable, how do you get robocopy to report its failure correctly.
Or am I am completely on the wrong track here?