ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Robocopy source folder and all subfolders

    IT Discussion
    3
    9
    1.1k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      Markferron
      last edited by

      I'm looking to use robocopy to copy over a network share drive. For some reason I can't find a way to copy over the source file and all of its subfolders. This is the command I am running from the destination server:

      Robocopy “\titus\TestIT” “E:\File Shares” /MIR /ZB /DCOPY:T /COPYALL /R:1 /W:1 /V /TEE /LOG:Robocopy.log

      This will only copy the subfolders and everything in them and not the actual "TestIT" folder. I can create a TestIT folder on the destination and then manually share it through appropriate groups in AD, but I know I'm missing something simple.

      M 1 Reply Last reply Reply Quote 0
      • ObsolesceO
        Obsolesce
        last edited by

        Try something like this:

        robocopy F:\source\TestIT \\destination\d$\DIR\ /MIR /FFT /R:3 /W:10 /Z /NP /NDL /LOG+:\\logLocation\log.txt
        

        Note above:
        SOURCE first
        DESTINATION second

        1 Reply Last reply Reply Quote 1
        • M
          Markferron @Markferron
          last edited by

          Robocopy “\titus\TestIT” “E:\File Shares” /MIR /ZB /DCOPY:T /COPYALL /R:1 /W:1 /V /TEE /LOG:Robocopy.log

          Oh that's weird. It's leaving out my second "\"

          This is what I actually run:
          Robocopy “\\titus\TestIT” “E:\File Shares” /MIR /ZB /DCOPY:T /COPYALL /R:1 /W:1 /V /TEE /LOG:Robocopy.log

          ObsolesceO 1 Reply Last reply Reply Quote 0
          • ObsolesceO
            Obsolesce @Markferron
            last edited by Obsolesce

            @markferron said in Robocopy source folder and all subfolders:

            Robocopy “\titus\TestIT” “E:\File Shares” /MIR /ZB /DCOPY:T /COPYALL /R:1 /W:1 /V /TEE /LOG:Robocopy.log

            Oh that's weird. It's leaving out my second "\"

            This is what I actually run:
            Robocopy “\\titus\TestIT” “E:\File Shares” /MIR /ZB /DCOPY:T /COPYALL /R:1 /W:1 /V /TEE /LOG:Robocopy.log

            Okay that makes more sense.

            Try this:

            "\\titus\TestIT" "E:\File Shares\TestIT" /MIR /ZB /DCOPY:T /COPYALL /R:1 /W:1 /V /TEE /LOG:Robocopy.log
            
            M 1 Reply Last reply Reply Quote 1
            • dafyreD
              dafyre
              last edited by

              Does that command preserve permissions and all that to?

              ObsolesceO 1 Reply Last reply Reply Quote 0
              • ObsolesceO
                Obsolesce @dafyre
                last edited by Obsolesce

                @dafyre said in Robocopy source folder and all subfolders:

                Does that command preserve permissions and all that to?

                If you want to do that, the /copyall switch does it.

                1 Reply Last reply Reply Quote 1
                • M
                  Markferron @Obsolesce
                  last edited by

                  @tim_g Oh wow I didn't realize that it would create the file for you.
                  Works well. I just have to manually share the file and give AD groups the correct Permissions (Sharing tab) under Advanced Sharing. It also still retains the correct permissions under Security as well.

                  I'm going to leave out /V and /TEE and add in /NP /NDL since there is a log at then end. Seems like a waste of energy (also seemed to run faster in my tests).

                  ObsolesceO 1 Reply Last reply Reply Quote 0
                  • ObsolesceO
                    Obsolesce @Markferron
                    last edited by

                    @markferron said in Robocopy source folder and all subfolders:

                    I'm going to leave out /V and /TEE and add in /NP /NDL since there is a log at then end.

                    Yeah I use /NP and /NDL and LOG+

                    1 Reply Last reply Reply Quote 1
                    • M
                      Markferron
                      last edited by

                      One more question. I'm going to add multi-threading to make it run fast (/MT) and the machine I'm running this command on (which is the destination machine) is a virtual machine. Is there a correlation with number of threads to CPU core count or RAM?

                      1 Reply Last reply Reply Quote 1
                      • 1 / 1
                      • First post
                        Last post