Robocopy unter XP/W2K3

Übersicht

Robocopy ist eine freies Befehlszeilentool von Microsoft (Bestandteil von div. Resource-Kits). Gegenüber ‘xcopy’ verfügt Robocopy über einen gewaltigen Funktionsumfang.

Besonders nützlich ist der Schalter ‘/SEC’. Dieser kopiert die NTFS-Zugriffsrechte der Dateien und Verzeichnisse mit. Auch praktisch: Der Schalter ‘/MIR’ spiegelt ein Verzeichnis, so dass im Zielverzeichnis Dateien gelöscht werden, die im Quellverzeichnis nicht mehr existieren. Kopiervorgänge können auch nur zu bestimmten Zeiten oder nach einer bestimmten Anzahl an Änderungen in einem Verzeichnis stattfinden.

Robocopy hat seinen Namen von ‘robust copy’. Diesem Ziel wird das Programm durch sein fehlertolerantes Verhalten gerecht. Mit dem Schalter ‘/R:n’ versucht Robocopy bei einem Fehlschlag den Kopiervorgang noch n-mal. Der Schalter ‘/W’ legt fest, wieviele Sekunden zwischen den Versuchen vergehen sollen.

Für Administratoren, die Daten migrieren oder ein Backup erstellen wollen, bietet Robocopy viele praktische Features. Aber auch im täglichen Gebrauch machen Fortschrittsanzeige, Bandbreitenkontrolle und umfangreiche Einstellungsmöglichkeiten die Arbeit angenehm.

Beispiele

Kopieren von ALLES mit Unterverzeichnissen (auch leere) inkl. der NTFS-ACLs

robocopy QUELLE ZIEL /SCHALTER
cd d:\
robocopy  c: d: /e /w:1 /r:1 /sec

robocopy man page

Syntax
      ROBOCOPY source_folder destination_folder [file(s)_to_copy] [options]

Key
   file(s)_to_copy : A list of files or a wildcard.
                     If no source "file(s)_to_copy" are specified robocopy
                     will default to copying *.*
   Source options
                /S : copy Subfolders
                /E : copy Subfolders, including Empty Subfolders.
              /SEC : copy SECurity info (both source and dest must be NTFS).##

                /A : copy only files with the Archive attribute set.
                /M : like /A, but remove Archive attribute from source files.
            /LEV:n : only copy the top n LEVels of the source tree.##

         /MAXAGE:n : MAXimum file AGE - exclude files older than n days/date.##
         /MINAGE:n : MINimum file AGE - exclude files newer than n days/date.##
                     (If n < 1900 then n = n days, else n = YYYYMMDD date).

   Copy options
                /L : List only - don't copy, timestamp or delete any files.
              /MOV : MOVe files (delete from source after copying).##
             /MOVE : Move files and dirs (delete from source after copying).

                /Z : copy files in restartable mode (survive network glitch).##

              /R:n : number of Retries on failed copies - default is 1 million.
              /W:n : Wait time between retries - default is 30 seconds.
              /REG : Save /R:n and /W:n in the Registry as default settings.

              /TBD : wait for sharenames To Be Defined (retry error 67).##

   Destination options

  /A+:[R][A][S][H] : set file Attributes on destination files - add.
  /A-:[R][A][S][H] : set file Attributes on destination files - remove.
              /FAT : create destination files using 8.3 FAT file names only.##
           /SECFIX : FIX SECurity info on existing files and dirs.##
           /TimFix : FIX Timestamp on all existing destination files,
                     including skipped files. ##
                     (prior to version 1.95 this was /T it's not backwards compatible
                      so scripts that use /T may fail)

           /CREATE : CREATE directory tree structure + zero-length files only.

            /PURGE : delete dest files/folders that no longer exist in source.
              /MIR : MIRror a directory tree - equivalent to /PURGE plus all subfolders (/E) ##

   Logging options
                /L : List only - don't copy, timestamp or delete any files.
               /NP : No Progress - don't display % copied.
         /LOG:file : output status to LOG file (overwrite existing log). ##
        /LOG+:file : output status to LOG file (append to existing log). ##

Advanced options you'll probably never use
               /XO : eXclude Older - if destination file exists and is the same date
                     or newer than the source - don't bother to overwrite it.
         /XC | /XN : eXclude Changed | Newer files
         /XX | /XL : eXclude eXtra | Lonely files and dirs. 
                     An "extra" file is present in destination but not source, 
                     excluding extras will delete from destination. 
                     A "lonely" file is present in source but not destination
                     excluding lonely will prevent any new files being added to the destination.
               /IS : Overwrite files even if they are already the same.

/XF file [file]... : eXclude Files matching given names/paths/wildcards.##
/XD dirs [dirs]... : eXclude Directories matching given names/paths.    ##
                     XF and XD can be used in combination  e.g.
                     ROBOCOPY c:\source d:\dest /XF *.doc *.xls /XD c:\unwanted /S 

            /MAX:n : MAXimum file size - exclude files bigger than n bytes. ##
            /MIN:n : MINimum file size - exclude files smaller than n bytes.##
  /XA:[R][A][S][H] : eXclude files with any of the given Attributes
  /IA:[R][A][S][H] : Include files with any of the given Attributes ##

                /X : report all eXtra files, not just those selected & copied.
                /V : produce Verbose output log, showing skipped files.
              /ETA : show Estimated Time of Arrival of copied files.

UP

 
wissen/microsoft/microsoft_windows_w2k3_xp_robocopy_vielseitiges_kopieren_inklusive_acls.txt · Zuletzt geändert: 05.09.2010 20:31
 
Recent changes RSS feed Donate Valid XHTML 1.0 Valid CSS Recent cached RSS feed cacert-signed web site: inhalt.serviert.de