# Solved: Robocopy skips all files



## stevesmith (Apr 6, 2009)

I'm using robocopy (ver XP010) on a Windows XP laptop to copy user files to another drive for backup.

robocopy "c:\my documents" "Z:\myname\my documents" /XO /M /ZB /E /MIR /log:c:mylog.txt /TEE

It creates all of the directories and subdirectories but doesn't copy any of the files. The log shows no errors - total dirs 162 copies 162, total files 1458 *skipped* 1458.

To minimize variables I tried using a new usb external NTFS hard drive (Z) but it still skips all of the files. I've verified the permissions and owership of the files and everthing seems in order. The problem is limited to this computer, the other computers in the group are OK. Any suggestions?

I just found out that 2 of the 6 computers in this group fail so I will be compairing files and permissions etc. to see what the two failed ones have in common against the working ones.


----------



## TheOutcaste (Aug 8, 2007)

stevesmith said:


> robocopy "c:\my documents" "Z:\myname\my documents" /XO /M /ZB /E /MIR /log:c:mylog.txt /TEE


Do the files have the Archive bit set? If not, they will be skipped per the /M switch.

Jerry


----------



## stevesmith (Apr 6, 2009)

Thanks Jerry, It seems to be working. I changed the options to:
/E /XO /ZB /NP /log:C:RoboLog.txt /TEE /R:2
I inherited this process (problem) and not sure why the options were set the way they were. The object of the copy (after the initial copy) is to copy only files that are new or have been modified. Will the /XO option take care of this or do I need to use another one. I reviewed the RoboCopy manual but didnt see anything that compared the date and size of the source and destination files. 
Again, thank you very much for your help.


----------



## TheOutcaste (Aug 8, 2007)

The */XO* should be all you need.
Search the manual for *Using Robocopy File Classes*, it has a table showing how files are classified based on Time, Size, Attributes, and if they exist in the Source, Destination, or both. Page 15 in the PDF manual if we have the same version.

If your destination is formatted NTFS (and this is just for backup, not moving to a different PC) you may want to include either */COPY:DATS* to copy Security settings or */COPYALL* to copy Security, Owner, and Auditing settings. If you don't copy the security settings (or the destination is formatted FAT/FAT32) anyone with access to the backup drive can view the files.
Including the Security settings will prevent regular users from being able to view the files on the backup drive (that haven't given Everyone permission of course). Admin users may have to take ownership to view them.

I would suggest adding */W:5*; usually no need for a 30 second wait copying to an external. And using the */ZB* switch can slow it down quite a bit. I would try it first without that switch and add it only if you find that it's really needed. /Z is most useful if the files are very large, where restarting from the point of failure can be quite helpful. Seems if it's going to fail on a 4 GB transfer, it's always the last couple hundred bytes.

HTH

Jerry


----------



## stevesmith (Apr 6, 2009)

I made the changes suggested and ended up with these option:
/E /XO /NP /log:C:RoboLog.txt /TEE /R:2 /W:5
The backups worked great. I tried the */COPYALL* but it didn't work. None of the file were copied (over written) to the backup. Not sure why but I will continue to do some testing. I will try the */COPY:dats* to see if that works. But at least we have backups of all the files. I will close the thread after the additional testing.Thanks again.


----------



## stevesmith (Apr 6, 2009)

I will mark this solved and do additional testing on the /COPYALL.


----------

