Robocopy mirror option unnecessarily copies unchanged files to cloud

Ron Sipherd 241 Reputation points
2023-08-22T19:05:35.4766667+00:00

I have a Visual Basic 2022 app running on Windows 10 64-bit, which calls Robocopy with the mirror option. Basically it works perfectly.

Including when the destination folder is on a drive letter mapped to a NAS drive connected via a hub.

But not when the destination folder is on a drive letter mapped to cloud storage. Robocopy wants to copy every file, even ones whose file dates match on both source and destination.

Windows File Explorer shows (for example) the file in each location with identical "Date modified" values; but Robocopy ignores that when the destination file is in the cloud, mapped to a drive letter.

How can I avoid copying every file every time to the cloud destination?

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
11,447 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Limitless Technology 44,206 Reputation points
    2023-08-23T09:16:59.32+00:00

    Hello Ron,

    Thank you for your question and for reaching out with your question today.

    Robocopy's behavior can sometimes be affected by how it interacts with network and cloud storage. Here are a few considerations and steps you can take to address the issue:

    The /FFT (File-Fix Time) option can help mitigate timestamp differences between systems. It forces Robocopy to round file times to the nearest 2 seconds, which can be helpful when dealing with certain network and cloud storage systems that may have different time precision.

    The /XO (Exclude Older) option tells Robocopy to skip copying files if the source file is older than the destination file.

    Use the /XCT option to compare file attributes and timestamps when determining whether to overwrite files.

    Here's an example command to include these possible options:

    robocopy "source" "destination" /MIR /FFT /XO /XCT

    If the reply was helpful, please don’t forget to upvote or accept as answer.


  2. Ron Sipherd 241 Reputation points
    2023-09-08T03:17:40.72+00:00

    It's a little early to break out the champagne, but the /fft operand has solved the problem in my tests so far; thanks!

    The /xo operand did not seem to make a difference; and I don't see an /xct operand in the online documentation. Is it described somewhere?

    0 comments No comments

  3. Ron Sipherd 241 Reputation points
    2023-09-08T03:20:51.11+00:00

    Oops, double-posted, deleting second copy.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.