Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
NAME
syncdir - synchronize two directories. 

SYNOPSIS
syncdir [OPTION...] SOURCE DESTINATION 

DESCRIPTION
syncdir synchronizes the DESTINATION directory with files and sub-directories as defined in the SOURCE directory. Files or directories found in the DESTINATION directory that do not exist in the SOURCE directory will be removed after synchronization. 

OPTIONS
-I
Prompt before removal. 

-i
Prompt before overwrite. 

-n
Do not remove those files and directories that found in DESTINATION but do not exist in SOURCE. 

-p
Preserve the last-modified time of the file. 

-u
Copy only when the source file is newer than the destination file, or when the destination file is missing.

EXAMPLE
To synchronize a destination folder to a source folder

No Format
syncdir SourceFolderyPath DestinationFolderPath 

To synchronize a destination folder to a source folder with prompting for override and removal of files
No Format
syncdir -i -I SourceFolderPath DestinationFolderPath 

To synchronize a destination & source without removing files/folders found in the destination folder that do not exist in the source folder
No Format
syncdir -n SourceFolderPath DestinationFolderPath 

To synchronize a destination & source without removing files/folders found in the destination folder that do not exist in the source folder
No Format
syncdir -n SourceFolderPath DestinationFolderPath 

NOTES

If both -I and -n are specified, -n will take precedence.