comandos robocopy

Upload: htunubala250874

Post on 12-Feb-2018

245 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/23/2019 Comandos Robocopy

    1/34

    Robocopy is a 32-bit command-line tool used for file replication. This tool helpsmaintain identical copies of a directory structure on a single computer or in separate

    network locations. Robocopy is included in theMicrosoftWindowsResource Kit.

    Robocopy version XP! re"uires #icrosoft$%indows$&erver 23' #icrosoft$%indows$XP' #icrosoft$%indows$2' or #icrosoft$%indows (T$version)..

    *sing Robocopy' you can copy a single directory' or you can recursively copy adirectory and its subdirectories. The tool classifies files by whether they e+ist in thesource directory' in the destination directory' or in both. ,n the latter case' the toolfurther classifies files by comparing time stamps and file sies between the source fileand the corresponding destination file. ou control which classes of files are copied.,f a file e+ists in both the source and destination locations' by default Robocopy copiesthe file only if the two versions have different time stamps or different sies. This

    saves time if the source and destination are connected by a slow network link. ou canalso specify that copies are restarted in the event of a failure' which saves even moretime when your network links are unreliable.Robocopy allows you to do the following/

    *se file names' wildcard characters' paths' or file attributes to include or e+clude

    source files as candidates for copying.

    0+clude directories by name or by path.

    1elete source files and directories after copying that is' move rather than copy

    them.

    1elete destination files and directories that no longer e+ist in the source.

    4ontrol the number of times the program retries an operation after encountering a

    recoverable network error. &chedule copy 5obs to run automatically.

    &pecify when copying is to be performed.

    #onitor a directory tree for changes.

    &electively copy file data.

    Contents

    (ew 6eatures in Robocopy 7ersion XP! 3

    4ommand-line Reference 8

    *sage (otes !!

    9ackwards 4ompatibility !!

    *sing Robocopy %ithin a *(,X &hell !!Processing a 1irectory Tree !!

    Retrying :fter a 6ailed 4opy !2

    &pecifying 6ile and 1irectory (ames !3

    *sing Robocopy 6ile 4lasses !)

    Robocopy.exeRobust File Copy UtilityVersion XP010

    Important

  • 7/23/2019 Comandos Robocopy

    2/34

    2

    *sing Precise 6ile Times and ;ong 6ile (ames !

    4opying (T6& &ecurity ,nformation !>

    #oving 6iles !?

    #inimiing 1irectory 6ragmentation 2

    Robocopy @ob 6iles 2

    &cheduling Robocopy @obs 23

    #onitoring a 1irectory Tree 2)

    4ontrolling 9andwidth *sage 2.3 6:T file system format.

    or-in+ it/ File ttributes9y default' Robocopy ignores most source file attributes read-only' archive' system'and hidden when selecting files to copy. :ny file matching other specified conditionsis copied regardless of its attribute settings. ou can use command-line switches tomodify this default behavior' as described in the following sections.

  • 7/23/2019 Comandos Robocopy

    18/34

    1)

    Inclu%in+ or 6xclu%in+ Files ,ase% on peci'ie%

    ttributesThe /IA:5R6A6S6H6C6N6E6T6O7switch includes only files with one or more of thespecified attributes set. 6iles that do not have any of the specified attributes set aree+cluded from further processing and are not copied./IAcan be useful in data staging applications. 6or e+ample' you can specify /IA:Rtocopy only read-only files from a test %eb server to a live %eb server. 1evelopers canremove the read-only attribute from files on the test server while they edit and test thefiles. *ntil the read-only attribute is turned on again' these files are not replicated onthe live server.:nother switch' /XA:5R6A6S6H6C6N6E6T6O7' can be used to e+clude files if one ormore of the specified attributes is set. 6or e+ample' you can specify /XA:Rto preventread-only files from being copied. &imilarly' /XA:SHe+cludes files with either thesystem or hidden attribute set.

    :ny combination of the following file attribute types can be used with /IAand /XA/R B Read only filesA B :rchive filesS B &ystem filesH B Cidden filesC B 4ompressed filesN B files (ot content inde+edE B 0ncrypted filesT B Temporary filesO B Affline files

    Robocopy processes /IAbefore /XAwhen both switches are specified in the sameRobocopy command.

    The /Aand /Mswitches allow only those source files with the archive attribute set tobe selected for copying. :fter copying' the archive attribute of the source file is eitherleft set if /Awas used or turned off if /Mwas used.

    Temporary files are normally deleted by the owning application when it is nolonger needed. %hen present on the system they are usually in use' and thereforecopy delays or failures will often occur if you try to copy them.

    Affline files have been physically removed to offline storage' and severe delaysmay be encountered in copying them' while the system retrieves them.

    C/an+in+ File ttributes 'ter Copyin+:fter a file has been successfully copied to the destination' the attributes of thedestination file are set by default to match those of the source file. To modify thisdefault behavior' you can use two other switches/

    /A+:5R6A6S6H6N6T7 sets attributes' and

    Note Note Note

  • 7/23/2019 Comandos Robocopy

    19/34

    1*

    /A-:5R6A6S6H6N6T7 resets or turns off attributes.6or e+ample' /A+:Aturns on the archive attribute in destination files to make it easier

    to back them up. /A-:RSHremoves the read-only' system' and hidden attributes fromdestination files to make it possible to see and edit them.The order of attribute operations on newly copied destination files is as follows/

    !. :ttributes are copied to the destination file from the source file.

    2. :ttributes specified by /A+are set turned on.

    3. :ttributes specified by /A-are reset turned off.

    :ny combination of the following file attribute types can be used with /A+and /A-/R B Read only filesA B :rchive filesS B &ystem filesH B Cidden filesN B files (ot content inde+ed

    T ? T%(@'!! 2"$%*

    9aintainin+ (rue Replication,f you re"uire the destination directory tree to be maintained as an exactmirror of thesource directory tree' you must delete files and directories from the destinationwhenever they disappear from the source. To accomplish this' use the /Eand /PURGEswitches in combination' or use the /MIRswitchThe/PURGEswitch causes Robocopy to delete all 0+tra and #ismatched destinationfiles and directories. :fter a #ismatched destination entry has been deleted' thecorresponding source entry is then treated as a ;onely file or directory and processedaccordingly. %hen JPURGEresults in the deletion of an 0+tra or #ismatcheddestination directory' the entire directory tree' including all subordinate files and

    subdirectories' is deleted even if /Sor /Eis not specified.

    *se/PURGEand /MIRvery carefully. ,f you inadvertently specify /PURGEor/MIRwith an e+isting destination directory' Robocopy can "uickly delete a largeamount of data from the destination.

    To prevent specific directory trees or files from being deleted when you use /PURGE'you must e+clude them by name' using the /XDor /XFoptions. /XDand /XFe+cludefiles and directories before all other processing.

    9ecause the /XXswitch e+cludes 0+tra files from further processing' the/PURGEswitch has no effect when /XXis also used.

    electi8ely Copyin+ File ataAnce a file has been selected for copying' you can choose precisely which dataassociated with the file is copied using the /COPY:copyflagscommand line argument'where copyflagscan be any combination of the following /

    Caution Note

  • 7/23/2019 Comandos Robocopy

    20/34

    20

    D to copy file 1ata

    A to copy file :ttributes

    T to copy file Timestamps

    S to copy (T6& &ecurity information :4;s

    O to copy (T6& Awnership information

    U to copy (T6& a*diting information

    6or ease of use the following alternative switches are also provided /

    /COPYALL copies everything e"uivalent to /COPY:DATSOU.

    /NOCOPY copies nothing which can be useful if /PURGEis also

    used.

    /SEC copies data' attributes' and (T6& :4;s like

    /COPY:DATS.:ny combination of these flags can be used' if you have the appropriate access rights.Cowever' if file data is copied' file timestamps are also copied. 9y default Robocopy

    assumes /COPY:DAT' and will copy file data' attributes' and timestamps.

    ou must have the #anage :udit ;ogs privilege to copy file auditinginformation using /COPYALLor /COPY:U.

    To refresh security information for e+isting destination files and directories withoutcopying file data' use the /ISswitch together with the /COPYswitch without the Dflag. 6or e+ample /IS/COPY:SOU would refresh all security information for allselected files' without copying any file data.

    To refresh time stamps on e+isting destination files and directories without copyingfile data' use the /ISswitch together with the /COPYswitch without the Dflag. 6ore+ample /IS/COPY:T would refresh all security information for all selected files'without copying any file data.

    Copyin+ N(F ecurity In'ormation,f both the source and destination directories reside on (T6& volumes' you can useRobocopy to copy (T6& security information. The most common re"uirement is topreserve (T6& :4;s during a copy. To do this' use the /SECswitch to copy (T6&file permissions when you copy files to a destination for the first time. ,f you also needto preserve (T6& ownership and auditing information you should use /COPYALL.

    ,f either the source or the destination volume is not (T6&' re"uests to copysecurity information are ignored. Anly one attempt is made to copy (T6& securityinformation for each file or directory copied.

    To refresh security information for e+isting destination files and directories withoutcopying file data' use the /ISswitch together with the /COPYswitch without the Dflag. 6or e+ample /IS/COPY:SOU would refresh all security information for allselected files' without copying any file data. &ee G&electively 4opying 6ile 1ataHearlier in this document for more information on /COPY.

    Note Note

  • 7/23/2019 Comandos Robocopy

    21/34

    21

    %hen you copy security information' you might notice a short delay after Robocopyprints its banner and before it displays arguments on the screen. This delay occurs

    because the program is checking for the (T6& file system at both ends. 4opying(T6& file security information fails if you have insufficient access privileges at eitherthe source or the destination.6or more information about access privileges' see G&cheduling Robocopy @obsH laterin this document.ou can copy security information between computers in separate domains even ifthey do not have trust relationships. Cowever' this applies security information that isunknown to the destination computer to the destination directory tree. %hen you viewthis information on the destination' user accounts are shown as G:ccount *nknown.H,f you copy these permissions back to a computer in the originating domain' they areinterpreted correctly again.

    ,f you copy (T6& security information :4;s along with file data' it is possible to

    copy files to which you have read access' but not write access. :fter such a file iscopied once' and the :4;s are applied' you may find that to get an G:ccess 1eniedHerror when you try to copy the file again.,n this situation you should use the /Bor /ZBswitch to copy the files in 9ackup #ode./Bcopies all files with backup semantics 9ackup #ode. /ZBfirst attempts to copyfiles in restartable mode for greater resiliency but if that fails with an G:ccess1eniedH error it automatically retries the copy using 9ackup #ode.

    ou must have the 9ackup 6iles and Restore 6iles privileges to copy files in9ackup #ode using /Bor /ZB.

    9ackup mode copies are not restartable' but they enable you to copy some files asa 9ackup Aperator that you would not be able to copy as a normal user.

    ,f you use /Z' /B' or /ZB' this can decrease Robocopy performance and throughputsignificantly' as these options involve e+tra overhead. These options are thereforeonly recommended when e+perience indicates you really need them.

    9o8in+ Files,n some situations' you may want to move files instead of copying them' especially ifdisk space is at a premium on your network. ou can use the /MOVEswitch to deletesource files from the source directory tree after they have been successfully copied tothe destination. /MOVEalso deletes empty directories from the source directory tree.0ven with /MOVEspecified' however' Robocopy deletes only those source files that

    it successfully copies to the destination. There is no guarantee that a skipped sourcefile is identical to its corresponding destination file even if the file times and sies areidentical until immediately following a successful copy. 6or that reason' some filesand directories such as skipped &ame files might remain in the source tree evenwhen /MOVEis specified. ou must determine whether to delete the remainingentries' and do so manually.

    Note Note Note

  • 7/23/2019 Comandos Robocopy

    22/34

  • 7/23/2019 Comandos Robocopy

    23/34

    23

    ROBOCOPY C:\$RC %:\$RC /E "#C" "#1" /$23E:$B2C45P

    This creates a Robocopy @ob 6ile named $B2C45P#RC6in the current directory thatencapsulates all the Robocopy parameters you specified prior to the J&:70 switch.

    JSAVEis actioned as soon as it is encountered on the command line. :nyarguments on the command line after JSAVEwill not be saved.

    JSAVEwrites to the specified file immediately' with no warning if the target filealready e+ists. 4are should be taken that you do not overwrite e+isting files whenusing JSAVEto create a new Robocopy @ob 6ile.

    To run the resulting Robocopy @ob 6ile at a later date' assuming the same workingdirectory' the following command would suffice /

    ROBOCOPY /6OB:$B2C45P

    :ctually' the command given above to create a Robocopy @ob 6ile might not be ideal'as after processing the JSAVEswitch and creating the Robocopy @ob 6ile' Robocopywould continue on and run with the given parameters.

    To 5ust create the Robocopy @ob 6ile without running the 5ob' you can use the /QUITswitch as follows /

    ROBOCOPY C:\$RC %:\$RC /E "#C" "#1" /$23E:$B2C45P /58*

    To view the verbatim contents of the generated .R4@ file you can either load it into ate+t editor e.g. by running .O*EP2% $B2C45P#RC6 or display its contents in theconsole window e.g. by running *YPE $B2C45P#RC6.

    :lternatively' you can get a more succinct idea of its contents by running /ROBOCOPY /6OB:$B2C45P /58*

    This causes Robocopy to load the file' display its parameters' and then "uit.

    To edit a 5ob file' you can use JJOB /SAVEand JQUITtogether as follows /ROBOCOPY /6OB:$B2C45P /XF "#1(P /$23E:$B2C45P /58*

    This loads the named 5ob' adds parameters to e+clude .C;P files from the 5ob' andupdates it on disk.

    :lternatively' you can edit 5ob files using a te+t editor. The format of Robocopy @ob6iles is straightforward. They contain one Robocopy parameter per line parameters

    containing colons' e.g. JLOG/logfileor JMAX/n,count as one parameter and must bespecified on a single line' with no spaces around the colon. ;eading white space isignored' as is any te+t after two consecutive colons' which is considered to be acomment. 7iew a Robocopy-generated .R4@ file to e+amine the format in more detail.

    Note Note

  • 7/23/2019 Comandos Robocopy

    24/34

    2!

    #ultiple Robocopy @ob 6iles can be specified on the Robocopy command line. 6ore+ample' you might have a large list of files to be e+cluded from copying. ou could

    use an editor to create a te+t file containing this e+clusion list as follows //XF

    file

    file

    file;

    ###

    Ance this is saved with a .R4@ suffi+' e.g. EXC(5%E#RC6' it can be used in con5unction

    with other Robocopy @ob 6iles' for e+ample as follows /ROBOCOPY /6OB:$B2C45P /6OB:EXC(5%E

    %hen multiple 5ob files are used' their contents are cumulative. 6or e+ample if a5ob specifies JXA:Rand is used in con5unction with another thatspecifies JXA:SHthen the result will be JXA:RSH. This also means that you must

    make sure that only one source directory and only one destination directory isspecified in any set of 5ob files that are used together.

    ,t is sometimes useful to create Robocopy @ob 6iles that can be used as templates forsimilar types of copies' and for this purpose it is perfectly valid to save a 5ob filewithout specifying a source directory or destination directory or both. &uch a 5ob filecannot be run on its own' of course' unless the source and destination directories arespecified at run time.

    6or e+ample/ROBOCOPY "#c" "#-" /$23E:$B2C45P /58*

    4ould be used create a template 5ob $B2C45P#RC6for backing up source files.

    To use this template to back up different pro5ects you might later run/ROBOCOPY /6OB:$B2C45P C:\PRO6EC*$\PRO

  • 7/23/2019 Comandos Robocopy

    25/34

    2"

    Abviously' both a source directory and a destination directory must be specified' so/NOSDand /NODDare only useful in the creation of template 5ob files. Cowever'

    template 5ob files can be a powerful tool' as multiple 5ob files can be specified on asingle Robocopy command line.

    0+tending the e+ample of backing up source files further' you could create a template5ob apecifying file section options' then further 5obs for specific source code pro5ects/

    ROBOCOPY /.O$% /.O%% "#c" "#-" 024EF8(E /$23E:$B /58*

    ROBOCOPY C:\PRO6EC*$\PRO

  • 7/23/2019 Comandos Robocopy

    26/34

    2#

    Usin+ a User ccount

    ou can configure the &chedule service to log on as a user account. Ance the useraccount has been granted appropriate access to source and destination servers' you canschedule Robocopy 5obs to copy files between them.

    T' .'n2"&0!% )% S.%30$% *%!9".% )' $'& 'n * 0*%! ..'0n)

    !. ,n &ervices in 4ontrol Panel' click S.%30$%' and then click S)!)0@.

    2. ,n the S)!)0@ T@%bo+' click A0)'()".or Mn0$.

    3. ,n the L'& On A*bo+' select the account in which to run the service' andspecify the correct logon password.

    9ecause drive mappings can be changed by users' it is more reliable to use *(4names for source and destination directories in scheduled Robocopy 5obs. 6or

    e+ample/ROBOCOPYMMserver1Mshare1MsourceMMserver2Mshare2MdestV

    TheATcommand and the &chedule service are documented in %indows 2online Celp. The SOONcommand is documented in theMicrosoftWindows2000 Resource Kit.

    9onitorin+ a irectory (ree*sing the /MON:nand /MOT:mswitches you can #onitor the source directory treefor changes' and copy changes as and when they occur. The /MON:nswitch specifies

    the minimum number of changes that must occur before running again. The /MOT:mswitch specifies the minimum time' in minutes' that must elapse before running again.,f you only specify one of these switches' the other is assumed to have a value of !.

    %hen #onitoring is specified' Robocopy never terminates. ,nstead' it enters a loopthat performs a normal Robocopy pass and then monitors the source directory tree forchanges' until both nchanges have been detected and mminutes have elapsed. %henboth conditions are met' another Robocopy pass is started. This whole process ofcopying and monitoring is repeated' ad infinitum' until the user manually terminatesthe Robocopy process.

    :s a minimum' Robocopy monitors the source directory tree for changes to file anddirectory names' sies' and last write times. ,f attributes are to be copied Robocopy

    will also monitor the tree for attribute changes. &imilarly' if security information is tobe copied' Robocopy will also monitor the tree for security changes.

    4onse"uently' a user performing an edit and saving a single new file' for e+ample'may cause multiple changes of various types to be reported back to Robocopy.Therefore some e+perimentation may be re"uired to determine appropriate threshold

    (ip Note

  • 7/23/2019 Comandos Robocopy

    27/34

    2$

    values for /MONand /MOTfor each Robocopy 5ob' especially those monitoring busytrees.

    Controllin+ ,an%i%t/ Usa+e*sing the /RH:hhmm-hhmmswitch to specify Robocopys Run Cours you can definea time slot in which starting new copies is allowedS outside of this time slot newcopies will not be started' and Robocopy will sleep' waiting for the start time to comearound.

    9oth times must be in 2)-hour format' must be e+actly ) digits long in the range to 23

  • 7/23/2019 Comandos Robocopy

    28/34

    2)

    time interval before re"uesting the ne+t packet' thereby freeing up network bandwidth.:gain' e+perimentation may be re"uired to determine an appropiate value for /IPG.

  • 7/23/2019 Comandos Robocopy

    29/34

    2*

    /TSdisplays the file timestamps for every file processed.

    /FPreplaces simple file names with full file pathnames in the output.

    /NS(o &ies suppresses output of file sies.

    /NC(o 4lasses suppresses output of file class GTe+t TagsH see below.

    /NDL (o 1irectory ;ist suppresses output of the directory list. %hen /NDL

    is used' full pathnames of processed files are logged instead of the simple filename' so that problems can be pinpointed. 9ecause of this' note that log filescan actually increase in sie if /NDLis used. 1irectories deleted by /PURGEor which wouldbe deleted if /Lwas omitted' if /PURGEand /Lwere bothused are always logged even if JNDLis used.

    /NFL (o 6ile ;ist suppresses output of files processed. 6ile copy failures

    are still logged even if /NFLis used' so that problems can be isolated. 6ilesdeleted by /PURGEor which would be deleted if JLwas omitted' if/PURGEand /Lwere both used are always logged even if /NFLis used.

    /NJH (o @ob Ceader suppresses output of the 5ob header. /NJS (o @ob &ummary suppresses output of the 5ob summary.

    4ombinations of these switches allow "uite a bit of fle+ibility in terms of what islogged. 6or e+ample' you could use /NDL /NC /NSto produce a list of 5ust the fullpathnames of files that were processed during the run' or you could use /NDL /NFLtoproduce 5ust the summary report for the run see GRun &ummaryH below.

    (ext (a+s0ach line in the output log begins with a brief te+t tag' which is formatted according tothe following rules/

    :ll capital letters indicate an anomaly that should be investigated.

    ,nitial capital letters indicate a file that was selected for copying. :ll lowercase letters indicate a file that was skipped displayed only if the /V

    switch is used.

    The te+t tags that indicate copying are left-aligned. Tags that indicate skipping areright-aligned. Tags that indicate anomalies are placed farther to the left than other tags.0rror messages always start in the first column. This arrangement simplifies the taskof scanning through even a verbose listing' and makes it easier to identify newdownloads' anomalies' and network errors.,f few files are copied' the left margin of the output log is mostly blank. 4opied filesand anomalies are easily spotted non-blank entries in the left margin of the output log.

    (a+s 'or FilesThe following table lists the tags that apply to files.

    F"$% T& M%n"n&

    W#,:T4C The source file corresponds to a destination directory of the same name.The source file is skipped' and housekeeping of the destination tree isrecommended.

    W0XTR: 6ile The file e+ists in the destination but not the source an 0+tra file. &ome

  • 7/23/2019 Comandos Robocopy

    30/34

    30

    housekeeping of the destination tree may be re"uired.

    (ew 6ile The file e+ists in the source but not in the destination a ;onely file.The file is copiedS to skip this file' use /XL.

    lonely The file e+ists in the source but not in the destination a ;onelyfile.The file is skippedS to copy this file' omit /XL.

    (ewer The source file has a later time stamp than the destination file. The fileis copiedS to skip this file' use /XN.

    newer The source file has a later time stamp than the destination file. The fileis skippedS to copy this file' omit /XN.

    Alder The source file has an earlier time stamp than the destination file. Thefile is copiedS to skip this file' use /XO.

    older The source file has an earlier time stamp than the destination file. Thefile is skippedS to copy this file' omit /XO.

    4hanged The source and destination files have identical time stamps but differentfile sies. The file is copiedS to skip this file' use /XC.

    changed The source and destination files have identical time stamps but differentfile sies. The file is skippedS to copy this file' omit /XC.

    Tweaked The source and destination files have identical time stamps and filesies but different attributes. The file is copied because /IT has beenspecifiedS to skip this file' omit /IT.

    &ame The source and destination files have identical time stamps and filesies. The file is copiedS to skip this file' omit /IS.

    same The source and destination files have identical time stamps and filesies. The file is skippedS to copy this file' use /IS.

    attrib :t least one source file attribute matches the attributes specified by

    /XA. The file is skippedS to copy this file' modify or omit /XA.named The file is skipped because it was named following an /XFswitch. To

    process this file' amend the argument following /XF.

    large The file is skipped because it is larger than /MAX:nbytes. To processthis file' increase the value of n.

    small The file is skipped because it is smaller than /MIN:nbytes. To processthis file' reduce the value of /MIN:n.

    too old The file is skipped because it is older than the date defined by/MAXAGE:nor /MAXLAD:n. To process this file' amend nto specifyan earlier date.

    too new The file is skipped because it is newer than the date defined by/MINAGE:nor /MINLAD:n. To process this file' amend nto specify a

    more recent date.

  • 7/23/2019 Comandos Robocopy

    31/34

    31

    (a+s 'or irectoriesThe following table lists the tags that apply to directories.

    D"!%.)'! T& M%n"n&

    blank : normal directory.

    W#,:T4C This source directory corresponds to a destination file of the samename and cannot be processed. Cousekeeping of the destination isrecommended.

    W0XTR: 1ir The directory e+ists in the destination but not the source an 0+tradirectory. &ome housekeeping of the destination tree may be re"uired.

    lonely The directory e+ists in the source but not the destination a ;onelydirectory. The directory is skippedS to process this directory' omit /XL.

    named The directory is skipped because it was named following an /XDswitch. To process this directory' amend the argument following /XD.

    5unction The entry is actually a 5unction' and is skipped because /XJwasspecified. To process this 5unction and copy it as a directory' omit /XJ.

    Run ummary,f you have not specified the JNJS(o @ob &ummary switch' then before Robocopystops' it displays a summary of its activities at the command prompt or redirects theinformation to a file. This output summaries the volume of data processed in thefollowing format/

    Total 4opied &kipped #ismatch 6:,;01 0+tras

    1irs/ !3 !3 !

    6iles/ !

  • 7/23/2019 Comandos Robocopy

    32/34

    32

    The Times line of the summary provides timing information for the run' as describedin the following table. Times are displayed in CC/##/&& format.

    C'$0(n In2'!()"'n P!'9"3%3

    4opied Time spent copying files e+cluding retry wait times

    6:,;01 Time spent waiting between retries for failed operations

    0+tra Time spent scanning directories and performing other functions

    ;arge times in the 6:,;01 column usually indicate network problems.

    6inally' if files were copied' the &peed lines show throughput information' calculatedby dividing the volume of data copied by the time spent copying. The same data isdisplayed twice/ first in bytes per second bps' and then in megabytes per minutembJmin.

    Return Co%eThe return code from Robocopy is a bit map' defined as follows/

    H% B")

    V$0%

    D%."($

    V$0%

    M%n"n& I2 S%)

    +! != &erious error. Robocopy did not copy any files. This is either ausage error or an error due to insufficient access privileges onthe source or destination directories.

    +> > &ome files or directories could not be copied copy errorsoccurred and the retry limit was e+ceeded. 4heck these errorsfurther.

    +) ) &ome #ismatched files or directories were detected. 0+aminethe output log. Cousekeeping is probably necessary.

    +2 2 &ome 0+tra files or directories were detected. 0+amine theoutput log. &ome housekeeping may be needed.

    +! ! Ane or more files were copied successfully that is' new fileshave arrived.

    + (o errors occurred' and no copying was done. The source anddestination directory trees are completely synchronied.

    Note

  • 7/23/2019 Comandos Robocopy

    33/34

    33

    ou can use this information in a batch file to report the most serious anomalies' asfollows/

    if errorle?el ! ec-o """F2*2( ERROR""" A oto end

    if errorle?el ec-o ""F28(E% COP8E$"" A oto end

    if errorle?el ec-o "08$02*C1E$" A oto end

    if errorle?el ec-o EX*R2 F8(E$ A oto end

    if errorle?el ec-o Cop) successful A oto end

    if errorle?el D ec-o no c-ane A oto end

    :end

    :lternatively' full details of the return code could be reported as follows/

    if errorle?el ! ec-o """F2*2( ERROR""" A oto end

    if errorle?el ec-o F28( 08$0 X*R2 COPY A oto end

    if errorle?el ec-o F28( 08$0 X*R2 A oto end

    if errorle?el ; ec-o F28( 08$0 COPY A oto end

    if errorle?el ec-o F28( 08$0 A oto end

    if errorle?el ec-o F28( X*R2 COPY A oto end

    if errorle?el D ec-o F28( X*R2 A oto end

    if errorle?el 9 ec-o F28( COPY A oto end

    if errorle?el ec-o F28( A oto end

    if errorle?el 7 ec-o 08$0 X*R2 COPY A oto end

    if errorle?el ! ec-o 08$0 X*R2 A oto end

    if errorle?el ec-o 08$0 COPY A oto end

    if errorle?el ec-o 08$0 A oto end

    if errorle?el ; ec-o X*R2 COPY A oto end

    if errorle?el ec-o X*R2 A oto end

    if errorle?el ec-o COPY A oto end

    if errorle?el D ec-o no c-ane A oto end

    :end

    Fee%bac-6or "uestions or feedback concerning this tool' please contactrkinputmicrosoft.com.,f you want to report a problem encountered when using Robocopy' please supply thefollowing information.

    7ersion number

    Aperating system and &ervice Pack for all computers

    6ile system

    4omplete Robocopy command line or batch file

    Autput log

    1irectory listings

    1r. %atson log for application errors

  • 7/23/2019 Comandos Robocopy

    34/34