Solved

Robocopy

Posted on 2009-04-06
17
1,196 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
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
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 
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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Choosing CentOS 16 106
adding more drive space to the server 5 63
ThinkServer TS440 No RAID Volumes 4 61
Copying ALL contents of a thumbdrive with confidence. 3 34
Lets start to have a small explanation what is VAAI(vStorage API for Array Integration ) and what are the benefits using it. VAAI is an API framework in VMware that enable some Storage tasks. It first presented in ESXi 4.1, but only after 5.x sup…
In this article we will learn how to backup a VMware farm using Nakivo Backup & Replication. In this tutorial we will install the software on a Windows 2012 R2 Server.
This tutorial will walk an individual through the process of installing the necessary services and then configuring a Windows Server 2012 system as an iSCSI target. To install the necessary roles, go to Server Manager, and select Add Roles and Featu…
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…

790 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