1

I’m trying to copy all files that are:

  • changed (i.e.: they have a different size in either source or target)
  • Newer or older (they have a newer or older timestamp, i.e.: different date modified or date created). ...but without deleting any items in the target directory. By default, Robocopy would “replace” such files instead of just copying them.

This one I tried replaces files, instead of just copying them: Robocopy “Source folder” “Target folder” /E

Any help much appreciated.

Antonio23249
  • 1,111

1 Answers1

1

it's possible to preserve all timestamps in the copied output, including those of directories and their attributes. for example

Code:

robocopy.exe "<source>" "<destination>" *.* /E /V /R:1 /W:5 /COPY:DATS /DCOPY:DAT

Replace and with the appropriate directory paths, obviously.

. = match all files

/E = Copy sub-directories, including empty ones

/V = Verbose output, showing any skipped files

/R:1 = Number of retries on failed copies (in millions)

/W:5 = Wait time between retries (in seconds)

/COPY:DATS = Copy files' original Data (D), Attributes (A), Timestamps (T), NTFS ACL (S). (Personally I don't normally copy ACL info.)

/DCOPY:DAT = The above but for directories.

also for copying the modified data , may be this link can help

copy changed or newer data