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

Robocopy not coping/comparing correctly need help

Windows 2003 R2 Server

Robocopy  "n:\music\mp3 music albums" e:\music backup /E /Z /FFT /MIR >c:\util\robo.log

Trying to compare both folders and then only copy the difference
N:\music\mp3 music albums is the primary folder
e:\music is the backup folder

I was using teracopy for this but it copies all files everytime
trying to reduce network traffic

Before I ran the robocopy both folders where in sync

Now after running robocopy

N drive 4283 files
           1655 directories

E drive 1749 files
            1655 directories

what am I missing here?
Thomas Grassi
Thomas Grassi
4 Solutions
Kent DyerIT Security Analyst SeniorCommented:
OK...  Let's break this apart..

Robocopy  "n:\music\mp3 music albums" e:\music backup /E /Z /FFT /MIR >c:\util\robo.log

Starting with Robocopy /?

These look good..
/Z :: copy files in restartable mode.
/MIR :: MIRror a directory tree (equivalent to /E plus /PURGE).

These don't make sense..  Remove them..
/E :: copy subdirectories, including Empty ones. (/Z above takese this in account already)
/FFT :: assume FAT File Times (2-second granularity). (Windows 2003, should have an NTFS file system, FAT file system is a very old file system)

Let's re-write the command:

Robocopy  "n:\music\mp3 music albums" e:\music backup /Z /MIR >c:\util\robo.log

Notice you are doing a re-direct of the screen output to a log..  However, why aren't you doing this?

          /LOG:file :: output status to LOG file (overwrite existing log).
         /LOG+:file :: output status to LOG file (append to existing log).

First one, over-writes the log each time..  Second one adds to an existing log..  Yes, your re-direct over-writes each time too.


Emmanuel AdebayoGlobal Windows Infrastructure Engineer - ConsultantCommented:
Ihave corrected the script as below, it should just copy and compare the file and copy the difference, the log in robo.log will show this for you.

I have been using this script for over five years to synch my web servers that are located in different data center in different region.

Robocopy  "n:\music\mp3 music albums" /MIR e:\music backup /E /ZB /COPY:DT /V >c:\util\robo.log

Thomas GrassiSystems AdministratorAuthor Commented:
Thanks everyone for replying.


I ran your example
Robocopy  "n:\music\mp3 music albums" e:\music backup /Z /MIR >c:\util\robo.log

same results the directories and sub dirctories are there but no files
to answer your question about the log file I have another command in my script that appends output to the same txt file.


I ran your example
Robocopy  "n:\music\mp3 music albums" /MIR e:\music backup /E /ZB /COPY:DT /V >c:\util\robo.log

Same results directories but no files.

The same number of files and directories remain as I posted in the beginning.

Does the destination folder need to be empty for the first time?

As I mentioned the destination folder was a mirrored image of the original folder using teracopy it just copied every file.

I got robocopy from the resource kit any updates that I might be missing?
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Please please try

Robocopy  "n:\music\mp3 music albums" /MIR e:\music backup /S /E /ZB /SEC >c:\util\robo.log
Thomas GrassiSystems AdministratorAuthor Commented:

Thanks for the responce

Robocopy  "n:\music\mp3 music albums" /MIR e:\music backup /S /E /ZB /SEC >c:\util\robo.log

Still only copying the directories and sub directories no files being copied.

I even renamed the destrination folder and let robocopy create the e:\music folder but same results the report showed that all the directories where NEW

Strange how the program name ROBOCOPY and it will not copy files lol
This is what I use currently to mirror differences between 2 data folders...I'll substitute your paths for the one's I use for source/dest:

robocopy "n:\music\mp3 music albums"  "e:\music backup" /zb /mir /NP /NDL /NFL /r:1 /w:1 /log:c:\util\robo.log

I don't have to use quotes with my scripts because I don't have spaces in the path but you do. I'm assuming that is completely fine with quotes.
Thomas GrassiSystems AdministratorAuthor Commented:
My mistake guys

the destination folder was e:\music  not e:\music backup

I thought backup was a robocopy parameter

When zabagaR put "e:\music backup" on the command line thats when I noticed  it.

Robocopy is now copying the files

will further test later today

Thanks again for all your help
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

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

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