• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 919
  • 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
SETLOCAL

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

notes.ini

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

/log:Notes.txt

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

/log:backup.txt
0
bowmanrn
Asked:
bowmanrn
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
0
 
oBdACommented:
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%
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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