I want to use Robocopy to copy files from a networked drive labeled M to an external USB drive attached to the server labeled Z.
I also want Robocopy to skip certain files, file types, and folders.
The M drive has roughly 73,000 files in 1,400 folders that total 420 GB of data.
I came up with the following code which I saved as a bat file. I added the /L at the end to test the command and saved the output to the file. This drive has all of my digital photos and videos on it and I want to be sure I do not screw this up. I think the code is working, but would feel better to have one or two Robocopy experts look at it first. Here is the code:
"C:\CopyRite XP\robocopy.exe" M:\ V:\M_Copy\ /V /TS /S /E /COPY:DAT /ZB /NP /R:1 /W:5 /DCOPY:T /LOG:"C:\Mdrive Copy Log.txt" /TEE /XF *.swp *.dmp *.tmp pagefile.sys hiberfil.sys Thumbs.db /XD "M:\RECYCLER" "M:\System temp" "M:\Temporary Internet Files" "M:\System Volume Information" "M:\wsus" "M:\ZZZ Delete files locally" "M:\ZZ Weight" /L
Here is the end of the log file:
Total Copied Skipped Mismatch FAILED Extras
Dirs : 1406 1400 6 0 0 0
Files : 73444 72717 727 0 0 0
Bytes : 418.331 g 416.160 g 2.170 g 0 0 0
Times : 0:02:16 0:00:00 0:00:00 0:02:16
From the above it looks like files and folders were skipped. The top of the log file had this in it which was encouraging:
Started : Wed Feb 15 21:12:28 2012
Source : M:\
Dest : V:\M_Copy\
Files : *.*
Exc Files : pagefile.sys
Exc Dirs : M:\RECYCLER
M:\Temporary Internet Files
M:\System Volume Information
M:\ZZZ Delete files locally
Options : *.* /V /TS /L /TEE /S /E /COPY:DAT /DCOPY:T /ZB /NP /R:1 /W:5
Finally, here is the detail of one skipped file: I notice that skipped files/folders are labeled "named"
named 1.9 g 2012/02/16 02:23:37 pagefile.sys
Question #1: Do you see any problems in the code or is it good to go? I would cut out the /L at the end before running.
Question #2: Please confirm that there is no way that this code would delete anything off the source drive.
Question #3: I plan to schedule this to run a few times a week. After the first long run, will Robocopy skip all identical files and only copy new ones?
Question #4: Since all of the data on this drive are my pictures and movies, I do not want to have any strange permission or security attributes. If my server completely melted, I want to be able to plug the USB into any PC and copy the files to the PC and have full access. Will the above code do this?
Let me know if you have any questions. Unfortunately, my server only has USB 2.0 ports. Unless my old version of Robocopy can multi-thread, this is going to take a long, long time for the first run.