Tuesday, November 3, 2015

RoboCopy Synch 2 Folders, Copy newer files between 2 dirs

Not true mirroring but its a good way to synch up a source a destination for newer files, new files and dirs, robocopy command line below:

@ECHO OFF
SET source="C:\Work"
SET dest="\\Server\Work"

ECHO ****************START  %DATE% %TIME% synch
ECHO Two way mirror between source: %source% and destination: %dest%, continue?
ECHO synch excluding older file, This should preserve newer copy exist in both locations

ECHO  ******* Start source to dest
robocopy %source% %dest% /E /DST /FFT /XO /XJ /ETA /S /R:100 /W:10 /NDL /NJH /NJS
ECHO  ******* Start dest to source
robocopy %dest% %source% /E /DST /FFT /XO /XJ /ETA /S /R:100 /W:10 /NDL /NJH /NJS

ECHO ****************DONE  %DATE% %TIME% synch

No comments:

Post a Comment