• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 934
  • Last Modified:

How do I get Robocopy to only copy the changed files?

I am using Robocopy to backup certain files on my computer to my network drive.  It is working fine except it copies files that I have not changed.  If I use the /XN switch then it will not copy changed files.  Out of 1400 files it copies 163 files like .jpg files.  I have also tried the /MIR option but it has erased files on the network.  Here is a copy of my batch file.  Thanks for your help.

Set @W32=C:\Program Files\Lotus\Notes\data\w32

SET @Notes=C:\Program Files\Lotus\Notes

SET @Lotus=C:\Program Files\Lotus\Notes\data

SET @MyShare=c:\Documents and Settings\%username%

ECHO Verifying / Updating Script Software Installation

md p:\(DSR)Backup\%username%\%computername%

c:\DSRBackup\robocopy "%@W32%" p:\(DSR)Backup\%username%\%computername%\Lotus_Notes\W32

c:\DSRBackup\robocopy "%@Notes%" p:\(DSR)Backup\%username%\%computername%\Lotus_Notes


c:\DSRBackup\robocopy "%@Lotus%" p:\(DSR)Backup\%username%\%computername%\Lotus_Notes *.id

desktop6.ndk names.nsf *.dic perweb.nsf perweb*.ntf /zb /r:0 /w:0 /eta /tbd /XO /np


c:\DSRBAckup\robocopy "%@MyShare%" p:\(DSR)Backup\%username%\%computername% /XD applica*

/XD cookies /XD history /XD Local* /XD temp* /XD Nethood /XD Printhoo* /XD Sendto /XD

Recent /XD Start* /XD Templates /XD UserData /XD Windows /zb /e /r:0 /w:0 /eta /tbd /XO /np

2 Solutions
colonytireDirector of TechnologyCommented:
I may be wrong here but Robo copy only copies changed files.  In the begining you have to have syncronization, from there you set the time intervak to check for changed files.  At that point if it sees a changed file, it copies only what it found as changed.

This might help:  http://www.ss64.com/nt/robocopyXP.html
robocopy will by default only copy files that are different from the ones in the target directory.
You might want to have a look at robocopy.doc in the installation directory of the Resource Kit Tools; it explains in detail the different situations that can happen when you copy directory trees.
Another important thing that might be a potential cause for trouble is that your @MyShare variable is set incorrectly.
Never, ever, use "c:\Documents and Settings\%username%" to access a users profile; this is *not* necessarily the correct path. Always use "%Userprofile%", which points to the root of the user's profile:
SET @MyShare=%Userprofile%
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

Tackle projects and never again get stuck behind a technical roadblock.
Join Now