最新消息:20210917 已从crifan.com换到crifan.org

windows下的用于文件拷贝的命令行工具 – robocopy(Robust File Copy)

Windows系统 crifan 2307浏览 0评论

Win7中有个命令行工具,叫做robocopy(Robust File Copy),用于拷贝文件。

功能比copy或xcopy更强大,包括能在拷贝文件同时保留之前文件的属性,支持断点续传等功能。

 

对应的用法,可以看这里的介绍:

Robocopy.exe Robust File Copy Utility Version XP010

http://theether.net/download/Microsoft/Utilities/robocopy.pdf

 

或者直接看此命令的help:

<p> </p><p>&nbsp;</p><p>C:UsersCLi&gt;robocopy /?</p><p>-------------------------------------------------------------------------------<br />ROBOCOPY :: Robust File Copy for Windows<br />-------------------------------------------------------------------------------</p><p>Started : Tue Nov 29 08:28:55 2011</p><p>Usage :: ROBOCOPY source destination [file [file]...] [options]</p><p>source :: Source Directory (drive:path or <a rel="nofollow" href="file://server/share/path">\serversharepath</a>).<br />destination :: Destination Dir (drive:path or <a rel="nofollow" href="file://server/share/path">\serversharepath</a>).<br />file :: File(s) to copy (names/wildcards: default is "*.*").</p><p>::<br />:: Copy options :<br />::<br />/S :: copy Subdirectories, but not empty ones.<br />/E :: copy subdirectories, including Empty ones.<br />/LEV:n :: only copy the top n LEVels of the source directory tree.</p><p>/Z :: copy files in restartable mode.<br />/B :: copy files in Backup mode.<br />/ZB :: use restartable mode; if access denied use Backup mode.<br />/EFSRAW :: copy all encrypted files in EFS RAW mode.</p><p>/COPY:copyflag[s] :: what to COPY for files (default is /COPY:DAT).<br />(copyflags : D=Data, A=Attributes, T=Timestamps).<br />(S=Security=NTFS ACLs, O=Owner info, U=aUditing info).</p><p>/DCOPY:T :: COPY Directory Timestamps.</p><p>/SEC :: copy files with SECurity (equivalent to /COPY:DATS).<br />/COPYALL :: COPY ALL file info (equivalent to /COPY:DATSOU).<br />/NOCOPY :: COPY NO file info (useful with /PURGE).</p><p>/SECFIX :: FIX file SECurity on all files, even skipped files.<br />/TIMFIX :: FIX file TIMes on all files, even skipped files.</p><p>/PURGE :: delete dest files/dirs that no longer exist in source.<br />/MIR :: MIRror a directory tree (equivalent to /E plus /PURGE).</p><p>/MOV :: MOVe files (delete from source after copying).<br />/MOVE :: MOVE files AND dirs (delete from source after copying).</p><p>/A+:[RASHCNET] :: add the given Attributes to copied files.<br />/A-:[RASHCNET] :: remove the given Attributes from copied files.</p><p>/CREATE :: CREATE directory tree and zero-length files only.<br />/FAT :: create destination files using 8.3 FAT file names only.<br />/256 :: turn off very long path (&gt; 256 characters) support.</p><p>/MON:n :: MONitor source; run again when more than n changes seen.<br />/MOT:m :: MOnitor source; run again in m minutes Time, if changed.</p><p>/RH:hhmm-hhmm :: Run Hours - times when new copies may be started.<br />/PF :: check run hours on a Per File (not per pass) basis.</p><p>/IPG:n :: Inter-Packet Gap (ms), to free bandwidth on slow lines.</p><p>/SL :: copy symbolic links versus the target.</p><p>/MT[:n] :: Do multi-threaded copies with n threads (default 8).<br />n must be at least 1 and not greater than 128.<br />This option is incompatible with the /IPG and /EFSRAW options.<br />Redirect output using /LOG option for better performance.</p><p>::<br />:: File Selection Options :<br />::<br />/A :: copy only files with the Archive attribute set.<br />/M :: copy only files with the Archive attribute and reset it.<br />/IA:[RASHCNETO] :: Include only files with any of the given Attributes set.<br />/XA:[RASHCNETO] :: eXclude files with any of the given Attributes set.</p><p>/XF file [file]... :: eXclude Files matching given names/paths/wildcards.<br />/XD dirs [dirs]... :: eXclude Directories matching given names/paths.</p><p>/XC :: eXclude Changed files.<br />/XN :: eXclude Newer files.<br />/XO :: eXclude Older files.<br />/XX :: eXclude eXtra files and directories.<br />/XL :: eXclude Lonely files and directories.<br />/IS :: Include Same files.<br />/IT :: Include Tweaked files.</p><p>/MAX:n :: MAXimum file size - exclude files bigger than n bytes.<br />/MIN:n :: MINimum file size - exclude files smaller than n bytes.</p><p>/MAXAGE:n :: MAXimum file AGE - exclude files older than n days/date.<br />/MINAGE:n :: MINimum file AGE - exclude files newer than n days/date.<br />/MAXLAD:n :: MAXimum Last Access Date - exclude files unused since n.<br />/MINLAD:n :: MINimum Last Access Date - exclude files used since n.<br />(If n &lt; 1900 then n = n days, else n = YYYYMMDD date).</p><p>/XJ :: eXclude Junction points. (normally included by default).</p><p>/FFT :: assume FAT File Times (2-second granularity).<br />/DST :: compensate for one-hour DST time differences.</p><p>/XJD :: eXclude Junction points for Directories.<br />/XJF :: eXclude Junction points for Files.</p><p>::<br />:: Retry Options :<br />::<br />/R:n :: number of Retries on failed copies: default 1 million.<br />/W:n :: Wait time between retries: default is 30 seconds.</p><p>/REG :: Save /R:n and /W:n in the Registry as default settings.</p><p>/TBD :: wait for sharenames To Be Defined (retry error 67).</p><p>::<br />:: Logging Options :<br />::<br />/L :: List only - don't copy, timestamp or delete any files.<br />/X :: report all eXtra files, not just those selected.<br />/V :: produce Verbose output, showing skipped files.<br />/TS :: include source file Time Stamps in the output.<br />/FP :: include Full Pathname of files in the output.<br />/BYTES :: Print sizes as bytes.</p><p>/NS :: No Size - don't log file sizes.<br />/NC :: No Class - don't log file classes.<br />/NFL :: No File List - don't log file names.<br />/NDL :: No Directory List - don't log directory names.</p><p>/NP :: No Progress - don't display percentage copied.<br />/ETA :: show Estimated Time of Arrival of copied files.</p><p>/LOG:file :: output status to LOG file (overwrite existing log).<br />/LOG+:file :: output status to LOG file (append to existing log).</p><p>/UNILOG:file :: output status to LOG file as UNICODE (overwrite existing log).<br />/UNILOG+:file :: output status to LOG file as UNICODE (append to existing log).</p><p>/TEE :: output to console window, as well as the log file.</p><p>/NJH :: No Job Header.<br />/NJS :: No Job Summary.</p><p>/UNICODE :: output status as UNICODE.</p><p>::<br />:: Job Options :<br />::<br />/JOB:jobname :: take parameters from the named JOB file.<br />/SAVE:jobname :: SAVE parameters to the named job file<br />/QUIT :: QUIT after processing command line (to view parameters).<br />/NOSD :: NO Source Directory is specified.<br />/NODD :: NO Destination Directory is specified.<br />/IF :: Include the following Files.</p>
&nbsp;

转载请注明:在路上 » windows下的用于文件拷贝的命令行工具 – robocopy(Robust File Copy)

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
93 queries in 0.182 seconds, using 23.40MB memory