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?
LVL 23
Thomas GrassiSystems AdministratorAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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?
10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

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.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2003

From novice to tech pro — start learning today.