Robocopy Mirror Backup gone awry

4

1

I have created a simple batch file script for running Robocopy. It is set to make a backup of my user account folder to my external hard drive.

Here's the parameters for Robocopy:

ROBOCOPY "C:\Users\Finnly" "F:\Backups\Finnly (Backup)" /ZB /COPY:DAT /DCOPY:T /MIR /256 /MT:32 /XF ... /XD ... /R:3 /W:10 /V /TS /FP /ETA /LOG+:F:\Backups\Sync.log /TEE

For some reason when I run it, it backs up the files and then it seems to back them up again. The size of my user account directory is 18.3 GB but the backup of it occupies over 30 GB. After reading the contents of the log generated, it is obvious that it's copying files more than once. Why is this happening?

I'm running Windows Seven Home Premium 64-bit.

Aznfin

Posted 2010-05-31T16:37:24.240

Reputation: 477

Answers

4

I would suspect this is because Windows 7 has a lot of junction points for compatibility with older operating systems (eg My Music points to Music, My Pictures to Pictures etc).

If you add the /XJ switch, this will exclude the junction points. However that could mean that you are not backing up everything you think, especially if there is a junction point inside C:\Users\Finnly which points to somewhere outside that folder.

sgmoore

Posted 2010-05-31T16:37:24.240

Reputation: 5 961

1I modified the parameters to include the /XJ switch and it worked like a charm. The final size of the backup was 16.2 GB which is less than my actual user folder because I had excluded folders and files. I double-checked everything and I didn't miss any files or folders from junction points that are pointed outside the folder. Thanks for your help! – Aznfin – 2010-05-31T22:28:03.497