Link to home
Start Free TrialLog in
Avatar of Jeremy-M
Jeremy-M

asked on

Correct ROBOCOPY Syntax Win2K Server files to Win03 Server Std Edition

I'm having trouble with the robocopy command.

I want to copy all files and files in a directoty or drive on one server to another server including, attributes, tims stamps, NTFS security info and ownership info. I want to copy the entire directory tree including empty directories.  I just cannot seem to get the syntax right.

For example, C: D: *.* /COPYALL creates the directory but no files and the Security is wrong.

For example, C: D: *.* /S/E Invalid Parameter #4

For example, C: D: *.* /S/E Invalid Parameter #4

For example, C: D: *.* /S/E/COPYALL Nothing happens

For example, C: D: *.* /S/E/COPYALL This command copies all the folders, subfolders and file but the security permissions are wrong.

For example, C: D: *.* /S/E/COPY:/DATSU Invalid Parameter #4

I am copying files from a Windows 2000 Server to a Windows 2003 Server (Std Edition)

Can someone give me the correct syntax to copy all the folders, subfolders (the entire directory tree with Data, Attributes, Timestamps, NTFS Security, NTFS Auditing Information that will work correctly.


Thanks
ASKER CERTIFIED SOLUTION
Avatar of HatchIT
HatchIT

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Sham Haque
this from the ROBOCOPY readme:

True Replication
===========

If you require the destination directory tree to be maintained as an exact mirror of the source directory tree, and have files and directories deleted from the destination whenever they disappear from the source, you can use the /PURGE switch (at your own risk).

/PURGE causes Robocopy to delete ALL Extra and Mismatched destination files and directories. After a Mismatched destination entry has been deleted, the corresponding source entry is then treated as a Lonely file or directory, and processed accordingly.

Where /PURGE results in the deletion of an Extra or Mismatched  destination directory, the entire directory tree, including all subordinate files and subdirectories, will be deleted.

You should use /PURGE with extreme caution. If you specify /PURGE along with an incorrect (but existing) destination directory, Robocopy WILL DELETE lots of data from the destination very quickly.  You use the /PURGE option at your own risk.

Note that the /XX switch excludes Extra files from further processing, so /PURGE will have no effect if /XX is also used.