Posted on 2013-06-10
Last Modified: 2013-06-10
Helo Guys,  

I need to copy a folder with different files with shared and ntfs permission to another server.  I have used this robocopy command and it doesn't work..

robocopy \\server2003\D$\Shared File Finance \\server2003new\E$ /mir

Server 2003 is my old domain controller
Shared File Finance is the shared folder with permissions
Server2003new is my new server
E is the drive when i want my shared folder ....

Please help
Question by:techlabtest
LVL 84

Expert Comment

ID: 39233945
Since the source path contains spaces, you need to enclose it in double quotes, otherwise robocopy will be unable to parse the arguments:
robocopy "\\server2003\D$\Shared File Finance" "\\server2003new\E$" /mir
LVL 84

Expert Comment

ID: 39233956
Oh, and you might want to add the following options:
- /nfl and /ndl will suppress the file and folder listing of successfully copied files/folders; errors will still be logged. Having log entries for files that were successfully copied usually are of no interest and only clutter up the log
- /r:0 and /w:0, as retries in a LAN are usually unnecessary; if a copy doesn't work, it's mostly "access denied", either because the file is in use or because someone thought he's so very smart that he doesn't need his files backed up, denying admin access. Retries won't change that and will only slow down the copy (default is 1'000'000 retries with 30 seconds pause, which takes some patience).
/log:"SomeLogFile.log" to be able to check if/where errors happened, and /tee to send output to the console as well as the log file.
- /np to disable the progress indicator. If writing to a log, it's counterproductive, because it fills the log with control characters.
- /z, /b, or /zb will slow down the copy because of the additional overhead, with not much benefit in a LAN. /z is useful if copying large files over an unstable WAN connections, and /b only if the account you're using doesn't have full control over the folder tree.
LVL 38

Expert Comment

by:Gerwin Jansen, EE MVE
ID: 39234017
Since you want file security copied as well, I suggest you add /SEC (and optionally: /SECFIX):

/SEC :: copy files with SECurity
/SECFIX :: FIX file SECurity on all files, even skipped files.
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

LVL 84

Expert Comment

ID: 39234049
gerwinjansen is of course correct; just note that /sec copies only the DACL, not the owner or auditing settings. If you need the owner as well, use /copy:DATSO (Data, Attributes, Security, Owner), and add U (/copy:DATSOU, the same as /copyall) to copy auditing information as well.

Note that the 2003 robocopy.exe does not copy directory time stamps; if you require these, you'd need to use a machine running Vista/W2k8 or later to run the copy and add /dcopy:T to the command line.

Finally, Share permissions are not part of the file system, they're part of the LanManServer's service configuration. You can either run an export/import, or try permcopy.exe (form the W2k3 Resource Kit Tools as well).
Saving and restoring existing Windows shares

Author Comment

ID: 39234062
Thanks a lot for your response but it copies only the files found in the folder Shared File Finance...
I want it to copy the whole folder with shared and security permission.....

C:\>robocopy "\\server2003\D$\Shared File Finance" "\\terminalserver\E$" /mir

   ROBOCOPY     ::     Robust File Copy for Windows     ::     Version XP010

  Started : Mon Jun 10 13:04:04 2013

   Source : \\server2003\D$\Shared File Finance\
     Dest : \\terminalserver\E$\

    Files : *.*

  Options : *.* /S /E /COPY:DAT /PURGE /MIR /R:1000000 /W:30


                           7    \\server2003\D$\Shared File Finance\
        *EXTRA Dir        -1    \\terminalserver\E$\RECYCLER\
        *EXTRA Dir        -1    \\terminalserver\E$\RECYCLER\S-1-5-21-3536306644
          *EXTRA File                110        De22.bat
          *EXTRA File                441        De23.doc
          *EXTRA File                112        De24.bat
          *EXTRA File                110        De25.txt
          *EXTRA File                650        De26.vbs
          *EXTRA File                 56        De27.cmd
          *EXTRA File                 69        De28.txt
          *EXTRA File                 65        desktop.ini
          *EXTRA File               5620        INFO2
100%        New File                  56        Access.cmd
100%        New File                  69        New Text Document.txt
100%        New File                 110        Test.txt
100%        New File                 650        test.vbs
100%        New File                 110        test2.bat
100%        New File                 441        Test2.doc
100%        New File                 112        test3.bat


                Total    Copied   Skipped  Mismatch    FAILED    Extras
     Dirs :         1         0         1         0         0         2
    Files :         7         7         0         0         0         9
    Bytes :     1.5 k     1.5 k         0         0         0     7.0 k
    Times :   0:00:00   0:00:00                       0:00:00   0:00:00

    Speed :               19846 Bytes/sec.
    Speed :               1.135 MegaBytes/min.

    Ended : Mon Jun 10 13:04:04 2013

Please help

Expert Comment

ID: 39234116
Did you add the /S to inlcude sub folders (inc empty ones)
LVL 84

Expert Comment

ID: 39234167
* For the NTFS permissions, see gerwinjansen's comment http:#a39234017 and my comment http:#a39234049.
* For Share permissions, see my comment http:#a39234049 as well.
* For further hints on options, see my comment http:#a39233956 (I doubt that you really want to use "/R:1000000 /W:30", where a single blocked file can basically stop the whole copy operation).

techlabtest uses /mir (see his question), which is the equivalent of /e and /purge; you can see that in the "Options" line as well.
And note that /s copies subfolders except empty ones; /e would copy subfolders including empty ones.

Author Comment

ID: 39234202
thanks oBdA...i tried but still i got errors... i dont know if i miss something..

Can you please write the full command?

LVL 84

Accepted Solution

oBdA earned 500 total points
ID: 39234214
robocopy.exe "\\server2003\D$\Shared File Finance" "\\terminalserver\E$" *.* /mir /copyall /r:0 /w:0 /np /tee /log:robocopy.log

Open in new window

If it fails, please post the log file here inside {code} tags (replace the curly brackets with square brackets, or just use the bar above the Edit field).

Author Comment

ID: 39234280
Thanks a lot for your patience oBdA!!!......You solved my problem...

God bless...

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question