none
Robocopy move complex folder structure from multiple sources to network drive RRS feed

  • Question

  • Hello,

    I need to solve the following problem and I would like to know if I can to this with Copyrobot, I am asking here, because I have never done anything with Copyrobot before. 

    I have one network drive and X computers from which I need to move data to the network drive. The folder structure on PC1 could look like this:

    -/root

    --/project1

    ---/name1

    ----/date0101

    -----/file1.x

    On PC2 it could look like this:

    -/root

    --/project1

    ---/name1

    ----/date0101

    -----/file2.x

    --/project2

    ---/name2

    ----/date0102

    -----/file1.x

    Now on the network drive I would like to save the following:

    -/root

    --/project1

    ---/name1

    ----/date0101

    -----/file1.x

    -----/file2.x

    --/project2

    ---/name2

    ----/date0102

    -----/file1.x

    This this possible with CopyRobot ? And if yes, how would I start. Thanks in advance

    • Moved by EugeneLeitanMVP Friday, October 28, 2016 6:11 AM it's not about the SCDPM
    • Moved by Bill_Stewart Friday, October 28, 2016 2:43 PM Not a scripting question
    Wednesday, October 26, 2016 6:43 PM

Answers

All replies

  • You can use use robocopy to copy from all users' machine to the same destination and it will automatically do what you are requesting as long as you do not use the PURGE parameter.

    For example, create a batch file that has this:

    robocopy \\PC1\Root \\Server\FileShare </E + options you need>

    robocopy \\PC2\Root \\Server\FileShare </E + options you need>

    etc

    The above will copy everything in root on PC1 to the file share and copy everything from PC2 root to the same share, combining both roots in the destination. Note that if the file exists on both PC1 and PC2, it will be replaced.

    Also, robocopy stands for Robust File Copy, not robot copy :)

    Wednesday, October 26, 2016 7:20 PM
  • Thank you very much Emmanuel, you really helped me :) I have 2 more question though:

    1) If the same folder exists on both machines, the folders wont be replaced but if the file is named the same, the files will be replaced ?

    2)Is it possible to prevent that files will be replaced ? Fx by adding "-v2" to the file name ?

    Thanks a lot!

    Saturday, October 29, 2016 12:07 PM
  • No problem. As for the questions:

    1. Yes, that's correct, though you do have switches that you can use if you want to prevent robocopy from overwriting files

    2. It gets a bit tricky here. Robocopy does not have a rename switch that you can use if the file exists. You can use the switch /XO to exclude copying files that are older than files already present in the destination. Otherwise, you will have to code the way you want files to be copied. PowerShell will be more useful here than robocopy in my opinion.

    Saturday, October 29, 2016 2:08 PM
  • Hi johnny jo,

    It’s a helpful suggestion as Emmanuel R said. For the robocopy command Syntax:

    robocopy <Source> <Destination> [<File>[ ...]] [<Options>]

    <source> Source Directory (local or network path)

    <destination> Destination Directory (local or network path) and

    [file…] Specifies the file or files to be copied.

    To get more example about robocopy command, we could check the link below.

    http://social.technet.microsoft.com/wiki/contents/articles/1073.robocopy-and-a-few-examples.aspx

    Hope it will be helpful to you


    Please remember to mark the replies as an answers if they help and unmark them if they provide no help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Monday, October 31, 2016 2:23 AM
    Moderator