Windows Robocopy


robocopy <Source> <Destination> [<File>[ ...]] [<Options>]

ParameterDescription
<Source>
Specifies the path to the source directory.
<Destination>
Specifies the path to the destination directory.
<File>
Specifies the file or files to be copied. You can use wildcard characters (* or ?), if you want. If the File parameter is not specified, *.* is used as the default value.
<Options>
Specifies options to be used with the robocopy command.       
File selection options
OptionDescription
/a
Copies only files for which the Archive attribute is set.
/m
Copies only files for which the Archive attribute is set, and resets the Archive attribute.
/ia:[RASHCNETO]
Includes only files for which any of the specified attributes are set.
/xa:[RASHCNETO]
Excludes files for which any of the specified attributes are set.
/xf <FileName>[ ...]
Excludes files that match the specified names or paths. Note that FileName can include wildcard characters (* and ?).
/xd <Directory>[ ...]
Excludes directories that match the specified names and paths.
/xct
Excludes changed files.
/xn
Excludes newer files.
/xo
Excludes older files.
/xx
Excludes extra files and directories.
/xl
Excludes "lonely" files and directories.
/is
Includes the same files.
/it
Includes "tweaked" files.
/max:<N>
Specifies the maximum file size (to exclude files bigger than N bytes).
/min:<N>
Specifies the minimum file size (to exclude files smaller than N bytes).
/maxage:<N>
Specifies the maximum file age (to exclude files older than N days or date).
/minage:<N>
Specifies the minimum file age (exclude files newer than N days or date).
/maxlad:<N>
Specifies the maximum last access date (excludes files unused since N).
/minlad:<N>
Specifies the minimum last access date (excludes files used since N) If N is less than 1900, N specifies the number of days. Otherwise, N specifies a date in the format YYYYMMDD.
/xj
Excludes junction points, which are normally included by default.
/fft
Assumes FAT file times (two-second precision).
/dst
Compensates for one-hour DST time differences.
/xjd
Excludes junction points for directories.
/xjf
Excludes junction points for files.
Example: robocopy "C:\ftp_aloha" "d:\ftp_aloha" /xf *.bat *.ctl
copy files from C:\ftp_aloha to d:\ftp_aloha exclude the files whose extension is .bat or .ctl

Example: robocopy /mov "Z:\TomcatLogs\WestfieldPortal\j2ee" "F:\LogArchive\WFPortal01\C\TomcatLogs\WestfieldPortal\j2ee"  /minage:7 "errorLog.log*.log" 

move files from Z:\TomcatLogs\WestfieldPortal\j2ee to F:\LogArchive\WFPortal01\C\TomcatLogs\WestfieldPortal\j2ee
which older than 7 days and file name like "errorLog.log*.log"

Speed: 
2GB/min 
1,000,000files / hour
Pay attention to the memory usage

The following table lists and describes the return codes that are used by the Robocopy utility.
ValueDescription
0No files were copied. No failure was encountered. No files were mismatched. The files already exist in the destination directory; therefore, the copy operation was skipped.
1All files were copied successfully.
2There are some additional files in the destination directory that are not present in the source directory. No files were copied.
3Some files were copied. Additional files were present. No failure was encountered.
5Some files were copied. Some files were mismatched. No failure was encountered.
6Additional files and mismatched files exist. No files were copied and no failures were encountered. This means that the files already exist in the destination directory.
7Files were copied, a file mismatch was present, and additional files were present.
8Several files did not copy.
Note Any value greater than 8 indicates that there was at least one failure during the copy operation.



Comments

Popular posts from this blog

Nginx Proxy & Load Balance & LNMP

Snort+barnyard2+Snorby CentOS 6.5_64 Installation

ORACLE Error