Introduction to the quick file copy tool robocopy in Windows

Source: Internet
Author: User
I used robocopy to copy the output log of the file. It can be seen that the efficiency is very good. Copy 2729 folders of 152 files in documents in 27 minutes and 59 seconds.

Robocopy isWindows Server 2003 Resource KitDownload a tool in the toolboxWindows Server 2003 Resource Kit.

SetMove the file under Z: \ _ my_mediaX: \ _ my_mdeia directory
Robocopy Z: \ _ my_media X: \ _ my_mdeia/move/E

Do not copy *. BAK files
Robocopy Z: \ _ my_media X: \ _ my_mdeia/E/XF *. Bak

Do not copy files larger than MB. The unit is byte.
Robocopy Z: \ _ my_media X: \ _ my_mdeia/e/MAX: 100000

Copy the files that have been modified in the last seven days.
Robocopy Z: \ _ my_media X: \ _ my_mdeia/S/maxage: 7/minage: 1

RH indicates the 24-hour system. The following command indicates that the parameter range is from 0000 to 2359 from AM to AM.
Robocopy Z: \ _ my_media X: \ _ my_mdeia/e/RH: 1000-1700

 

More Command Options for robocopy:

Format: robocopy source destination...] [Options]

Source: Source directory (drive: \ path or \ Server \ share \ path ).
Directory: target directory (drive: \ path or \ Server \ share \ path ).
File: the file to be copied (name/wildcard: "*. *" by default "*.*").

I. Copy options:
Parameter description:
/S: Copy sub-directories, but do not copy empty sub-directories.
/E: Copy sub-directories, including empty sub-directories.
/Lev: N: only copies the first N layers of the source directory tree.
/Z: copy the file in restart mode.
/B: Copy files in backup mode.
/ZB: Use the restart mode. If access is denied, use the backup mode.
/Efsraw: Copies all encrypted files in efs raw mode.
/Copy: Copy Tag: content of the file to be copied (/copy: DAT by default ).
(Copy Tag: D = data, a = attribute, t = timestamp ).
(S = Security = ntfs acl, O = Owner information, u = audit information ).
/Dcopy: T: Specifies the copy directory timestamp.
/Sec: Copies secure files (equivalent to/copy: DATS ).
/Copyall: Copy all file information (equivalent to/copy: datsou ).
/Nocopy: do not copy any file information (used with/purge ).
/Secfix: security of all files, even files that are skipped.
/Timfix: indicates the time when all files are repaired, even if they are skipped.
/Purge: Delete the target file/directory that no longer exists in the source.
/MIR: Image directory tree (equivalent to/E and/purge ).
/MoV: Move a file (copy and delete it from the source ).
/Move: Move files and directories (copy and delete from the source ).
/A +: [rashcnet]: add the specified attribute to the copy file.
/A-: [rashcnet]: deletes a specified attribute from a copy file.
/Create: only create a directory tree and a file with zero length.
/Fat: only use the 8.3 FAT file name to create the target file.
/256: Close the support for ultra-long paths (> 256 characters.
/MON: N: Monitoring source; run again when more than N changes are found.
/MOT: M: Monitoring source; If changed, run it again within M minutes.
/RH: hhmm-hhmm: running hours-the time when a new copy can be started.
/PF: Check the running hours based on each file (rather than each step.
/IPG: N :: Program Compartment spacing (MS) to release bandwidth on low-speed lines.

Ii. file selection options:
Parameter description:
/A: only copy files with an archive property set.
/M: only copy files with archive attributes and reset the archive attributes.
/IA: [rashcneto]: contains only files with any given property set.
/XA: [rashcneto]: exclude files with any given property set.
/XF file [file]...: exclude files that match the given name/path/wildcard.
/XD directory [Directory]...: Exclude directories that match the given name/path.
/XC: exclude changed files.
/XN: exclude newer files.
/XO: exclude older files.
/XX: exclude unnecessary files and directories.
/XL: exclude isolated files and directories.
/Is: contains the same file.
/It: contains the adjusted file.
/MAX: N: Maximum File Size-exclude files larger than n Bytes.
/Min: N: Minimum File Size-exclude files smaller than n Bytes.
/Maxage: N: The longest time when a file exists-exclude files earlier than N days/date.
/Minage: N: specifies the minimum time when a file exists.-exclude files later than N days/date.
/Maxglad: N: Maximum last access date-exclude files not used since N.
/Minglad: N: Minimum last access date-exclude files used since N.
(If n <1900 then n = n days, else n = yyyymmdd date ).
/XJ: exclude joining points. (This is usually included by default ).
/FFT: Assume the FAT file time (2 seconds granularity ).
/DST: makes up for the DST time difference of one hour.
/Xjd: exclude directory joining points.
/Xjf: exclude file joining points.

Iii. Retry options:
Parameter description:
/R: N: Number of Retries for failed copies. The default value is 1 million.
/W: N: The waiting time between two retries. The default value is 30 seconds.
/REG: Save/R: N and/W: N in the registry as the default setting.
/TBD: Wait for the shared name to be defined (retry error 67 ).

Iv. logging options:
Parameter description:
/L: list only-do not copy, add timestamp, or delete any files.
/X: report all unnecessary files, not just selected files.
/V: generates detailed output and displays the skipped files.
/TS: Timestamp of the source file included in the output.
/FP: indicates the complete path name of the file in the output.
/Bytes: print the size in bytes.
/Ns: no size-the file size is not recorded.
/NC: no category-the file category is not recorded.
/Nfl: No file list-No file name is recorded.
/NDL: No directory list-No directory name is recorded.
/NP: No progress-the percentage of copies is not displayed.
/ETA: displays the expected time to arrive at the copied file.
/Log: file: outputs the status to the log file (overwrite existing logs ).
/Log +: file: outputs the status to the log file (appended to the existing log ).
/Unilog: file: outputs the status to the log file in Unicode mode (overwrite existing logs ).
/Unilog +: file: outputs the status to the log file in Unicode mode (appended to the existing log ).
/Tee: outputs to the console window and log files.
/Ntasks: no job header.
/NJS: No Job Summary.
/Unicode: output status in Unicode mode.

V. job options:
Parameter description:
/Job: Job name: extract parameters from the named job file.
/Save: Job name: Save parameters to the named job file
/Quit: process the command line and exit (view parameters ).
/Nosd: The Source directory is not specified.
/Nodd: The target directory is not specified.
/If: contains the following files.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.