Solved

Robocopy

Posted on 2009-04-06
17
1,199 Views
Last Modified: 2012-05-06
I need to use robocopy to copy all of the share drives from a server \\server\shared to an external drive F:.   Can someone please tell me the correct syntax to use in robocopy.  I want to copy all files and subdirectories as well as permissions.  Thanks.
0
Comment
Question by:PC4N6
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 6
  • 3
  • +1
17 Comments
 
LVL 70

Expert Comment

by:garycase
ID: 24081714
Robocopy \\server\shared F: /E /COPYALL
0
 
LVL 70

Expert Comment

by:garycase
ID: 24081735
You could also use Robocopy \\server\shared F: /E /COPY:DATSOU
which will do exactly the same thing.

The COPYALL option is the equivalent of the D, A, T, S, O, and U flags

D => Data
A => Attributes
T => Timestamps
S => Security
O => Owner Info
U => Auditing Info
0
 

Author Comment

by:PC4N6
ID: 24081827
When I try this it does copy the folder structure but no data inside the folders.  What am I doing wrong?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 70

Expert Comment

by:garycase
ID: 24081881
Apparently you need to explicity use the filespec (I haven't used this in a while).

e.g. Robocopy \\server\shared\*.*  F: /E /COPYALL
0
 

Author Comment

by:PC4N6
ID: 24081952
I get an error on the \\server\shared\*.* line.  Is that the proper syntax to copy everything in the directory?
0
 
LVL 70

Expert Comment

by:garycase
ID: 24082000
The syntax should be correct -- although Robocopy is supposed to default to *.* (so it shouldn't be explicity required).

Try   Robocopy \\server\shared\  F: /E /COPYALL

You may also have to specific a default folder on F: ... although that also shouldn't be needed.

As I noted, it's been a while since I used Robocopy ... you may want to review the syntax details here:
http://www.mydigitallife.info/2007/05/07/robocopy-syntax-command-line-switches-and-examples/

0
 
LVL 42

Expert Comment

by:paulsolov
ID: 24083686
Just one thing to add.  If you're using an external drive and you're trying to copy with NTFS permissions make sure that it's formatted with NTFS, a lot of these drives are formatted FAT32 by default
0
 
LVL 70

Expert Comment

by:garycase
ID: 24084055
Good catch r.e. the external drive's format => that's likely the issue here.

Change the external drive's format to NTFS and it should work fine.

You can do this without destroying any data by opening a command prompt and typing the following:

CONVERT <drive letter>: /FS:NTFS

where <drive letter> is the letter assigned to your external drive.
0
 

Author Comment

by:PC4N6
ID: 24088852
Thank you for NTFS info...I am running into another issue now.   Robocopy is copying all of the information, but is now stopped at a particular document due to access denied.  It says trying again in 30 seconds.  It just keeps trying...is there a way to skip those particular files?  Can I take ownership of them to copy them off separately?  Please advise.
0
 
LVL 42

Expert Comment

by:paulsolov
ID: 24088917
The retry switch is set to default.  Configure the retry switch to zero and it will skip it.  Also configure it to log so that you see which ones it skipped.

/R:n : Number of Retries on failed copies - default is 1 million. ---set to zero
/W:n : Wait time between retries - default is 30 seconds  ---set to zero
0
 

Author Comment

by:PC4N6
ID: 24088987
So will I need to start this all over?  And is this the correct syntax for logging and skipping and everything I need?

robocopy \\server\shared f: /e /copyall /r:0 /w:0

Thanks.
0
 

Author Comment

by:PC4N6
ID: 24089012
Also,  how do I stop the current process of it trying to retry every 30 secs?
0
 
LVL 42

Expert Comment

by:paulsolov
ID: 24089057
you would have to stop and restart, don't forget

/LOG+:file : Output status to LOG file (append to existing log).
0
 

Author Comment

by:PC4N6
ID: 24089626
so what is the whole syntax that i need to type so that i get logs and all?  is this correct?

robocopy \\server\shared f: /e /copyall /r:0 /w:0 /log+:"name of file (what do I put here"

Thanks.
0
 
LVL 70

Accepted Solution

by:
garycase earned 500 total points
ID: 24089681
Yes, that line should do everything you want here.   For "name of file" put the fully-qualified path to the file you want the log kept in -- e.g. F:\Backup.LOG  (You can use whatever name you want and put it wherever you want)
0
 

Expert Comment

by:rajeevy69
ID: 24703187
I am using following command in my bat file:
robocopy C:\Users\Rajeev\Documents C:\Users\Rajeev\Documents\copy  /copyall /r:0 /w:0 /log+:c:\rajeev.txt

When i click on bat file, it displays above getting executed again and again. But i dont see any new folder created or any content copied. Do i need something else apart from creating bat file. I mean is there any prerequirement to run this command.

also please guide me where i can be wrong.
0
 

Expert Comment

by:rajeevy69
ID: 24703507
I checked my log files and in log files, it is showing that all the files were skipped. Please find below details from log file:


-------------------------------------------------------------------------------
   ROBOCOPY     ::     Robust File Copy for Windows                              
-------------------------------------------------------------------------------

  Started : Wed Jun 24 23:06:02 2009

   Source : C:\Users\Rajeev\Documents\source\
     Dest : C:\Users\Rajeev\Documents\destination\

    Files : *.*
          
  Options : *.* /NDL /NFL /S /E /COPY:DATS /PURGE /MIR /B /R:2 /W:1

------------------------------------------------------------------------------


------------------------------------------------------------------------------

                Total    Copied   Skipped  Mismatch    FAILED    Extras
     Dirs :         1         0         1         0         0         0
    Files :         2         0         2         0         0         0
    Bytes :   124.8 k         0   124.8 k         0         0         0
    Times :   0:00:00   0:00:00                       0:00:00   0:00:00

    Ended : Wed Jun 24 23:06:02 2009

Experts please tell why its skipping files instead of copying
0

Featured Post

Get HTML5 Certified

Want to be a web developer? You'll need to know HTML. Prepare for HTML5 certification by enrolling in July's Course of the Month! It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
A look at what happened in the Verizon cloud breach.
This video teaches viewers how to encrypt an external drive that requires a password to read and edit the drive. All tasks are done in Disk Utility. Plug in the external drive you wish to encrypt: Make sure all previous data on the drive has been …
This Micro Tutorial will teach you how to reformat your flash drive. Sometimes your flash drive may have issues carrying files so this will completely restore it to manufacturing settings. Make sure to backup all files before reformatting. This w…

623 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