Solved

Robocopy

Posted on 2009-04-06
17
1,193 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
  • 6
  • 6
  • 3
  • +1
17 Comments
 
LVL 70

Expert Comment

by:garycase
Comment Utility
Robocopy \\server\shared F: /E /COPYALL
0
 
LVL 70

Expert Comment

by:garycase
Comment Utility
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
Comment Utility
When I try this it does copy the folder structure but no data inside the folders.  What am I doing wrong?
0
 
LVL 70

Expert Comment

by:garycase
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:PC4N6
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Also,  how do I stop the current process of it trying to retry every 30 secs?
0
 
LVL 42

Expert Comment

by:paulsolov
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

A bootable USB key can be very handy now-a-days. My favorite USB key consists of our Windows 7 image, network card drivers (to connect up to a Ghost server), the latest BIOS updates for all of our PCs and CopyWipe (to erase a retired PC) Creating…
This article is an update and follow-up of my previous article:   Storage 101: common concepts in the IT enterprise storage This time, I expand on more frequently used storage concepts.
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…

771 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

16 Experts available now in Live!

Get 1:1 Help Now