Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

bidirectional robocopy sync

3,929 views
Skip to first unread message

Jeff Vandervoort

unread,
Feb 15, 2010, 11:23:13 PM2/15/10
to
Trying to set up near-real-time bidirectional sync between 2 folders on a
Win 7 client and an SBS2008 server. Offline files won't work because of the
way in which an app I use writes it's files; it has to be a local file or it
can take hours to save. But I want the files replicated to the server, and
from there to another client machine, using the same approach.

I *think* I've actually done pulled this off in the past...but it isn't
working now. These are my command lines:

ROBOCOPY "\\servername\sharename\foldername"
"\\clientname\sharename\foldername" /MIR /MON:1 /TBD /XO /XF filename.ext

ROBOCOPY "\\clientname\sharename\foldername"
"\\servername\sharename\foldername" /MIR /MON:1 /TBD /XO /XF filename.ext

Either command, run by itself, syncs source to destination just fine. But
when both are running simultaneously, files added in one folder will
subsequently be deleted as "Extra" files when discovered by one of the two
processes. Whether it gets copied or deleted just depends on which ROBOCOPY
command "discovers" the file first.

I read on some thread somewhere that /XO is needed for bi-directional syncs,
and that appears to be backed up by the Robocopy documentation. So I
included it in the command line, but it doesn't make any difference. (And
I'm using /TBD because the client machine is a notebook that's not always
connected.)

Wish you could set up DFSR with Win 7! I tried SyncToy 2.1 and couldn't get
it to run from Task Scheduler, so I gave up on that. DeltaCopy mangled the
ACLs and created several GB of recursive copies on both machines that took
some effort to undo. I know now what I did wrong with DeltaCopy and can
probably do it right the next time...but I'd really like to stick with
Robocopy if it can do the job. Can it?

--
Jeff Vandervoort
JRVsystems
http://www.jrvsystems.com

Jeff Vandervoort

unread,
Feb 16, 2010, 10:35:47 AM2/16/10
to

"I *think* I've actually done pulled this off"

I can't believe I done wrote that.<g> Editing error!

--
Jeff Vandervoort
JRVsystems
http://www.jrvsystems.com

"Jeff Vandervoort" <jeffv at jrvsystems dot com> wrote in message
news:uc9gC$rrKH...@TK2MSFTNGP06.phx.gbl...

cybers...@gmail.com

unread,
Jan 15, 2014, 9:19:11 AM1/15/14
to

> ROBOCOPY "\\servername\sharename\foldername"
> "\\clientname\sharename\foldername" /MIR /MON:1 /TBD /XO /XF filename.ext

> ROBOCOPY "\\clientname\sharename\foldername"
> "\\servername\sharename\foldername" /MIR /MON:1 /TBD /XO /XF filename.ext


I know this is an old post, but as I found it, others may too and it can still be useful.

I think the reason the commands above don't work is because of the use of the /MIR option, which is equivalent to /E (copy even empty directories) and /PURGE (delete files in the destination that are not in the source)

This is why 'EXTRA' files are being deleted.

Instead, replace /MIR with /E and this will stop.

It does mean though that if a file really is to be deleted, then the file on both servers needs to be deleted before ROBOCOPY is run again, or it will get copied again.

0 new messages