Questions

RoboCopy or XXCopy...whatever, I need syntax!?

+
0 Votes
Locked

RoboCopy or XXCopy...whatever, I need syntax!?

markoalleno
Seems simple, but I can't figure it out...I need a sync program that will overwrite all destination files, copy all new source files to destination (creating directories if needed), but not overwrite newer files in the destination. Specifically, I'm looking for the syntax to make this work with either RoboCopy or XXCopy. Really any program is fine, but I've tried UltraEdit's compare util, SyncBack, Vice Versa, SuperFlexible Sync, GoodSync, WinMerge, etc and can't find one that will overwrite all but leave newer destination files alone.
If no one here knows, can someone point me to a more proper forum for such an issue?

The source should remain untouched. Thanks for your help!
Clarifications Clarifications
+
0 Votes
donr484
Collapse -

I think you'd want to use this command line:

ROBOCOPY \\sourcepc\sourceshare \\destinationpc\destinationshare /COPYALL /B /E /XN /R:10 /W:2 /LOG:\\loggingpc\logfileshare\logfile.txt /NFL /NDL

Options:

/COPYALL copies all file attributes from source
/B uses backup mode
/E copy subdirectories including empty ones
/XN skips newer files already in the detination
/R:10 /W:2 will attempt with 10 retries and 2 seconds between each
/NFL don't include every file name in log (for a summary count)
/NDL don't include every folder name in log (for a summary count)

Note:

If you want to list all the folders and files affected in the log, remove /NFL /NDL

---

I usually build a summary log file, overwriting the last one. Then I use a vbscript to email the text of log file when it completes.

ROBOCOPY is very robust and flexible. On a WAN where manually copying and pasting 2GB+ files causes older WatchGuard Fireboxes to crash, ROBOCOPY will copy dozens of GBs of huge SQL BAK files over the internet without fail.

You can also specify complex scenarios like only copy the newest source file that starts with a certain name to the destination from specific sub folders in the source, which is great for folders containing timestamped filenames.

Hope it helps!

+
0 Votes
donr484
Collapse -

The retries options are for network failures. If you are copying from one local folder to another, you can probably remove /R:10 /W:2

If you are copying really large files over the internet or a particularly bad network connection, you can increase the number of retries and the wait time between each as well.

+
0 Votes
Slayer_
Collapse -

Sometimes its good to put some time between each packet as well so you don't hog the network connection to yourself for a long time.

+
0 Votes
donr484
Collapse -

I just noticed my command line got truncated above. All the options are listed below it at least. There are some issues with posts on this site.