Robocopy question about copying only new and changed files

BTS-0610 6 Reputation points
2020-12-07T19:59:18.187+00:00

Hello,

 I ran a robocopy command to copy all the files from one location to another. We did this in preparation to move the data "warehouse" from the old server to a new server because there were a lot of files to copy over. When we are ready make the new server our production server, I want to run another robocopy command to copy over only the new or changed files since the last full copy. 

Here is what I tried so far:

1) robocopy \Srv-oldserver\e$\ImageWarehouse \srv-newserver\E$\ImageWarehouse /xo 20201204

* This ran but did not copy any changes. Inside the "ImageWarehouse" folder there are subfolders so I wonder if that's the issue? 

2) robocopy \Srv-oldserver\e$\ImageWarehouse \srv-newserver\E$\ImageWarehouse /MAXAGE:20201204

* This seemed to copy 3 files, but I know there are more than 3 files that are newer than the MAX AGE date the subfolders of the"ImageWarehouse" folder. 

What do I need to add or change to make this work? Again- I only want new/ changed files beyond a certain date, which in turn are in subfolders of the "ImageWarehouse" folder.

Thank you,

Brian

Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
13,103 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ian Xue 37,106 Reputation points Microsoft Vendor
    2020-12-08T03:00:11.32+00:00

    Hi,

    /XO allows you to ecxlude the existing file from being overwrited if its modified time is newer than the source file. This switch does not accept a date and 20201204 is treated as the file name. As you had no file named 20201204, robocopy did nothing. To copy the newly modified files you can run the following command

    robocopy \\Srv-oldserver\e$\ImageWarehouse \\srv-newserver\E$\ImageWarehouse /xo   
    

    Best Regards,
    Ian

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

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.