Link to home
Start Free TrialLog in
Avatar of Alex Bolla
Alex Bolla

asked on

Robocopy

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.
Avatar of Gary Case
Gary Case
Flag of United States of America image

Robocopy \\server\shared F: /E /COPYALL
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
Avatar of Alex Bolla
Alex Bolla

ASKER

When I try this it does copy the folder structure but no data inside the folders.  What am I doing wrong?
Apparently you need to explicity use the filespec (I haven't used this in a while).

e.g. Robocopy \\server\shared\*.*  F: /E /COPYALL
I get an error on the \\server\shared\*.* line.  Is that the proper syntax to copy everything in the directory?
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/

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
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.
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.
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
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.
Also,  how do I stop the current process of it trying to retry every 30 secs?
you would have to stop and restart, don't forget

/LOG+:file : Output status to LOG file (append to existing log).
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.
ASKER CERTIFIED SOLUTION
Avatar of Gary Case
Gary Case
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
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