Question : Robocopy script

Hey all...I need assistance creating a robocopy script to copy files/permissions/timestamps from

2003 server - \\server1\share1
to
2008 server - \\share1\share2

Both shares are on the D Drive on both servers

Thanks

Answer : Robocopy script

That's not quite all for a file server migration, I'm afraid; copying subfolders, for example, might be useful, and a single file with "access denied" shouldn't block the copy for 30000000 seconds ...
Anyway, robocopy is a very powerful tool, but as such has a lot of options.
Note that unlike "copy" or Explorer, robocopy *by* *default* only copies files that don't exist in the target yet, so you can just run it several times and it will only copy the differences after the initial run.
Apart from /COPYALL, the /MIR option might be useful if you want to do several separate runs and delete files in the target that have been deleted in the source.
Some more hints:
- /mir already includes /e or /s
- /nfl and /ndl will suppress the file and folder listing of *successfully* copied files/folders; errors will still be logged. Having log entries for files that were successfully copied usually are usually of no interest and only clutter up the log
- /r and /w in a LAN are usually unnecessary; if a copy doesn't work, it's mostly "access denied", either because the file is in use or because someone thought he's so very smart that he doesn't need his files backed up, denying admin access. Retries won't change that and will only slow down the copy.
- /np disables the progress indicator. Very nice thing if you have the time to stare at the screen, willing the percentage to move, and if you copy files that are so large that a progress indicator actually makes sense. If writing to a log, it's totally counterproductive, because it fills the log with control characters.
- /z, /b, or /zb will slow down the copy because of the additional overhead, with not much benefit in a LAN. /z is useful if copying over WAN connections, and /b only if the account you're using doesn't have full control over the folder tree.
- You might want to pre-create the target "Main" folder and set the same permissions as the source folder; in my experience, robocopy sometimes fails to set the permissions correctly when it has to create the target folder. Everything below should be processed correctly.
Start the copy on one of the machines, for example the new one (W2k8 has robocopy installed by default); it'll be faster than using UNCs for both source and target.
So try something like this:
robocopy "\\OldServer\OldShare" "D:\SharedFolder" *.* /mir /r:0 /w:0 /tee /nfl /ndl /np /log+:"robocopy.log"

The W2k3 version is here:
Windows Server 2003 Resource Kit Tools
http://www.microsoft.com/downloads/details.aspx?FamilyID=9D467A69-57FF-4AE7-96EE-B18C4790CFFD&displaylang=en
Random Solutions  
 
programming4us programming4us