You are not logged in.

#1 09 Nov 2007 01:40

anderist
Member
Registered: 09 Nov 2007
Posts: 2

Merge shares

I need to write a Robocopy Script that will copy files and folders from one server share to the other. //Server 1\Public (Windows Server 2000) is the old file server share for a small office. //Server 2\Public (Windows Server 2003) is the new file sever share. To create //Server 2\Public i ran a Robocopy Script that mirrored //Server 1\Public to //server 2\Public. To make a long story short I had users on both \Public shares.  I need a robocopy script that will copy newer versions of files plus lonely files and directories from //Server 1\Public to //Server 2 \Public without overwriting newer versions of  files on //Server 2\Public or deleting extra files or directories that were created on //Server 2\Public.

Here is the robocopy script I came up with. I want to make sure this will work before running it.

Robocopy //Server 1\Public //Server 2\Public /S /COPYALL /XO /B /SEC

Thanks in advance for your help.

Anderist

Last edited by anderist (09 Nov 2007 01:41)

Offline

#2 09 Nov 2007 19:38

Simon Sheppard
Admin
Registered: 27 Aug 2005
Posts: 1,130
Website

Re: Merge shares

What if two users have updated the same file? - I would be reluctant to trust the last modified date as a reliable indicator of the best version to keep.

Running robocopy with the options you have above plus /L /LOG:file.txt /FP /TS will produce a log file without changing anything so you can see what will be overwritten in advance. This may become impractical if a very large number of files are involved.

A couple of other things -

1) make sure you have a good backup
2) Ensure none of the files are locked before running the bulk update by turning off the file shares.

Good luck

Offline

#3 09 Nov 2007 20:03

anderist
Member
Registered: 09 Nov 2007
Posts: 2

Re: Merge shares

Thanks Simon,

I will run it with the /L switch to compare files and look at the changes. I don't think there will be an abundance of files to merge (hoping anyway).  And yes I will have a good backup.

Anderist

Offline

Board footer

Powered by