hot to use robocopy in windows 7

ttrbrtsn
ttrbrtsn used Ask the Experts™
on
if the source drive is S:
if the target drive is T:

c:\robocopy r: t: /E

this will copy everything including empty folders.

now, lets say 2 weeks goes by. i want to copy only the new stuff and anything that is different and forget about the files that hasnt changed. how do i go about dong this?

thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2018
Distinguished Expert 2018
Commented:
You just run the same command again; robocopy will by default skip files that already exist in the target folder (same time, same size).
if you want to delete files in the target folder that have been deleted in the source folder, replace the /E with a /MIR.
use /XO

 /XO => exclude old files i.e. files on source that also exist at the destination but has older or same timestamp.

c:\robocopy  r: t: /E /XO
Bill PrewIT / Software Engineering Consultant
Top Expert 2016
Commented:
It's important to know exactly what you want to accomplish.  By default, as mentioned, ROBOCOPY runs in "mirror" mode (/MIR) where it will try and make the destination look just like the source folder at the point in time ROBOCOPY runs.  This means copying new or updated files, but also deleting any files from the destination that no longer exist in the source.

/XO on the other hand copies new and updated files, but leaves any files in the destination that exist without a matching file in the source.

~bp

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial