Page 1 of 1

Xcopy /d check

Posted: 17 Dec 2009 08:09
by captedgar
Hi there

Please suggest anything other than robocop or xxcopy if possible through DOS only.

I have 2 servers A and B.
I have a batch file which will sync B with A.
There are 3 identical folders on A and B and they both are of huge
size.
At the minute everytime we sync server B with A, we are copying the
entire folder across from B to A. This is very time consuming and i'm
trying to reduce this

The copy command i have at the minute is as follows i.e.


xCopy /S \\%2\g$\Utility\Mgt \\%1\g$\Utility\Mgt >>"file.log"


I was thinking of modifying the xcopy command as follows( would it
work)


xCopy /S /d \\%2\g$\Utility\Mgt \\%1\g$\Utility\Mgt >>"file.log"


Please note i have added /d as an extra switch and provided any date
and time values. Coz i can;t check this script at the minute, will my
above modified script compare Mgt folders on both the servers and only
copies those files which are mismatches. Is it also better to use a
beyond compare tool or something like that to achieve my objective?.

please advice

Posted: 18 Dec 2009 15:34
by avery_larry
It's the right idea. The /d switch will behave similar to robocopy. You're best to setup a little test on your workstation to make sure it's working. I can't remember off the top of my head -- it seems like there's some funky way to use the /d switch without a date. Perhaps it must be the last thing on the line or something.

Posted: 18 Dec 2009 22:22
by DosItHelp
One day I got tired of having to lookup the xcopy flags again for a common backup job I had needed and looked up many times before. So I looked one last time:

/D (without date) copies only new and newer files.
/S Copies directories and subdirectories except empty ones.
/C Continues copying even if errors occur.
/I If destination does not exist and copying more than one file,
/Y Suppresses prompting to confirm you want to overwrite an

and rearranged them to something I could remember:
xcopy /discy [source] [target]


"disc" and a "y" was easy to remember.
It works fine without a slash in front of each option, simply "/discy".

Hope this helps :wink: