Solved

Robocopy

Posted on 2013-06-10
10
714 Views
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
0
Comment
Question by:techlabtest
10 Comments
 
LVL 83

Expert Comment

by:oBdA
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
0
 
LVL 83

Expert Comment

by:oBdA
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.
0
 
LVL 37

Expert Comment

by:Gerwin Jansen
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.
0
 
LVL 83

Expert Comment

by:oBdA
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
http://support.microsoft.com/kb/125996
0
 

Author Comment

by:techlabtest
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
-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
Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

 
LVL 9

Expert Comment

by:TazDevil1674
ID: 39234116
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
 
LVL 83

Expert Comment

by:oBdA
ID: 39234167
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
 

Author Comment

by:techlabtest
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?

Thanks
0
 
LVL 83

Accepted Solution

by:
oBdA earned 500 total points
ID: 39234214
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
 

Author Comment

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

God bless...
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
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 strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
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 …

705 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now