Robocopy returns Success despite not finding Destination

17 views Asked by At

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.

  1. If SOURCE_DIR is empty, the first line after the header indicates 0
  2. IF DEST_DIR cannot be reached and throws an error, 0 should not be the return code.
  3. Since there must be a file in SOURCE_DIR (indicated by the 1), not all columns in the FILES row of the summary should be 0. THe file should "be" somewhere.
  4. ERROR 53 (DEST not reachable) RETRY LIMIT EXCEEDED are errors. After errors there is no summary.

2 Questions:

  1. What constellation can result in this incoherent output and return code.
  2. 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?

0

There are 0 answers