|
|
| Purpose: | Synchronize two directories |
| Format: | SYNC [/A:... /C /D /E /F /G /J /K /L /M /N[est] /O /P /Q /R /S[n] /T /V /W /X] dir1 dir2 |
| dir1 | First directory (and source for a /W) |
| dir2 | Second directory (and target for a /W) |
/A:... |
Attribute switch |
Modified files (not Archived) |
|
/C. |
Changed source files |
Disable |
|
Copy encrypted files |
Only if no target file |
||
No error messages |
Prompt |
||
No empty subdirectories |
Quiet |
||
Display percentage completed |
Replace |
||
H(idden included) |
Subdirectories included |
||
Match description |
Totals |
||
Restartable copy |
Verify |
||
Keep RDONLY attribute |
Delete non-matching target |
||
ASCII-mode FTP transfer |
(Clear archive bit) |
File Selection
Supports extended wildcards and ranges.
Internet: Can be used with FTP servers.
Usage:
SYNC will synchronize two directories, copying the updated files from each directory to the other.
Options:
| /A:... | Select only those files that have the specified attribute(s) set. See Attribute Switches for information on the attributes which can follow /A:. See the cautionary note under Advanced Features above before using /A: when both dir1 and dir2 contain file descriptions. Do not use /A: with @file lists. See @file lists for details. Hidden or system files selected by this option overwrite hidden or system files in the target directory. |
| /C | Copy files only if the destination file exists and is older than the source file. This option is useful for updating the files in one directory from those in another without copying any files not already in the target directory. Do not use /C with @file lists. See @file lists for details. |
| /G | Displays the percentage copied, the transfer rate (in Kbytes/second), and the estimated time remaining. Useful when copying large files across a network or via FTP to ensure the copy is proceeding. When /V is also used, reports percentage verified. |
| /I"text" | Select source files by matching text in their descriptions. See Description Ranges for details. |
| /J | Copy the files in restartable mode. The copy progress is tracked in the destination file in case the copy fails. The copy can be restarted by specifying the same source and destination file names. |
| /M | Copy only those files with the archive attribute set, i.e., those which have been modified since the last backup. The archive attribute of the source file will not be cleared after copying; to clear it use the /X switch, or use ATTRIB. Do not use /M with @file lists. See @file lists for details. |
| /N | Do everything except actually perform the copy. This option is useful for testing the result of a complex SYNC command. /N displays how many files would be copied. /N does not prevent creation of destination subdirectories when it is used with /S. |
A /N with one of the following arguments has an alternate meaning:
| d | Skip hidden directories (when used with /S) |
| e | Don't display errors |
| j | Skip junctions (when used with /S) |
| s | Don't display the summary |
| t | Don't update the CD / CDD extended directory search database (JPSTREE.IDX) |
| /P | Ask the user to confirm each source file. Your options at the prompt are explained in detail under Page and File Prompts. See also: the /Q option below. |
| /Q | Don't display filenames, percentage copied, total number of files copied, etc... When used in combination with the /P option above, it will prompt for filenames but will not display the totals. This option is most often used in batch files. See also /T. |
| /R | Prompt the user before overwriting an existing file. Your options at the prompt are explained in detail under Page and File Prompts. |
| /S | Copy the subdirectory tree starting with the files in the source directory plus each subdirectory below that. If the destination subdirectories don't exist, SYNC will attempt to create them. If SYNC /S creates one or more destination directories, they will be added automatically to the extended directory search database. |
If you attempt to use SYNC /S to copy a subdirectory tree into part of itself, SYNC will detect the resulting infinite loop, display an error message and exit. Do not use /S with @file lists. See @file lists for details.
If you specify a number after the /S, SYNC will limit the subdirectory recursion to that number. For example, if you have a directory tree "\a\b\c\d\e", /S2 will only affect the "a", "b", and "c" directories.
| /T | Turns off the display of filenames, like /Q, but does display the total number of files copied. |