Questions

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

Tags:
+
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!
  • +
    0 Votes
    ComputerCookie

    However using /purge with robocopy will delete all dir/files that no longer exist in the source!

    +
    1 Votes
    P_Faber

    That wasn't much of an answer, was it, ComputerCookie?
    How'd you go, markoalleno?
    FWIW, Total Commander has an excellent 'Synchronize Directories' (American spelling) function. Under Commands.
    See if that helps.

    +
    0 Votes
    PurpleSkys Moderator

    i'm hoping the OP has it fixed by now, it's only been four years

    Purpleskys
    TR Moderator

    +
    0 Votes

    Actually it's been 5 (FIVE!!) years! If it took you 5 years to come up
    with Total Commander, which is completely off-topic for the OPs
    question, how long did it take you to finish grade school?
    Yes, I'm being very BRUTAL, if you can't take it, then next time
    LOOK AT THE DATE before you make a fool of yourself.
    Oh, one last item, when it's been 5 years, it is extremely rude
    to belittle someone that tried to answer a question.
    Wizard57M
    TR Moderator

    +
    0 Votes
    Slayer_

    Harsh....

    As long as the OP didn't use /mir he was probably ok.

    +
    0 Votes
    donr484

    I'm a first time poster. I tried answering this several times. It doesn't seem to accept for some reason. I'll try several smaller answers...

    +
    0 Votes
    donr484

    That didn't work in IE9. Trying Chrome.

    +
    0 Votes
    donr484

    Chrome didn't work either. I had a URL pointing to the ROBOCOPY command line reference. Maybe this site didn't like the URL. Trying again without it...

    +
    0 Votes
    donr484

    That did it! I couldn't including the link to the ROBOCOPY command line in TechNet for whatever reason. The appropriate answer is below if it is still needed or can help others.

    +
    0 Votes
    donr484

    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

    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_

    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

    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.

  • +
    0 Votes
    ComputerCookie

    However using /purge with robocopy will delete all dir/files that no longer exist in the source!

    +
    1 Votes
    P_Faber

    That wasn't much of an answer, was it, ComputerCookie?
    How'd you go, markoalleno?
    FWIW, Total Commander has an excellent 'Synchronize Directories' (American spelling) function. Under Commands.
    See if that helps.

    +
    0 Votes
    PurpleSkys Moderator

    i'm hoping the OP has it fixed by now, it's only been four years

    Purpleskys
    TR Moderator

    +
    0 Votes

    Actually it's been 5 (FIVE!!) years! If it took you 5 years to come up
    with Total Commander, which is completely off-topic for the OPs
    question, how long did it take you to finish grade school?
    Yes, I'm being very BRUTAL, if you can't take it, then next time
    LOOK AT THE DATE before you make a fool of yourself.
    Oh, one last item, when it's been 5 years, it is extremely rude
    to belittle someone that tried to answer a question.
    Wizard57M
    TR Moderator

    +
    0 Votes
    Slayer_

    Harsh....

    As long as the OP didn't use /mir he was probably ok.

    +
    0 Votes
    donr484

    I'm a first time poster. I tried answering this several times. It doesn't seem to accept for some reason. I'll try several smaller answers...

    +
    0 Votes
    donr484

    That didn't work in IE9. Trying Chrome.

    +
    0 Votes
    donr484

    Chrome didn't work either. I had a URL pointing to the ROBOCOPY command line reference. Maybe this site didn't like the URL. Trying again without it...

    +
    0 Votes
    donr484

    That did it! I couldn't including the link to the ROBOCOPY command line in TechNet for whatever reason. The appropriate answer is below if it is still needed or can help others.

    +
    0 Votes
    donr484

    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

    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_

    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

    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.