Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 755
  • Last Modified:

Robocopy

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
0
techlabtest
Asked:
techlabtest
1 Solution
 
oBdACommented:
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
0
 
oBdACommented:
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.
0
 
Gerwin Jansen, EE MVETopic Advisor Commented:
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.
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
oBdACommented:
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
http://support.microsoft.com/kb/125996
0
 
techlabtestAuthor Commented:
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
-2189709435-737965347-500\
          *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
0
 
TazDevil1674Commented:
Did you add the /S to inlcude sub folders (inc empty ones)

http://technet.microsoft.com/en-us/library/cc733145(v=ws.10).aspx
0
 
oBdACommented:
techlabtest,
* 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).

TazDevil1674,
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.
0
 
techlabtestAuthor Commented:
thanks oBdA...i tried but still i got errors... i dont know if i miss something..

Can you please write the full command?

Thanks
0
 
oBdACommented:
Try
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).
0
 
techlabtestAuthor Commented:
Thanks a lot for your patience oBdA!!!......You solved my problem...

God bless...
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now