CPDUP(1)

NAME
cpdup - mirror filesystems

SYNOPSIS
cpdup [-v[vv..]] [-f] [-i0] [-q] [-o] [-m] [ -M file] [ -x file] [-X] source_dir target_dir

DESCRIPTION
The cpdup utility makes an exact mirror copy of the source in the destination, creating and deleting files and directories as necessary. UTimes, hardlinks, softlinks, devices, permissions, and flags are mirrored. By default, cpdup asks for confirmation if any file or directory needs to be removed from the destination and does not copy files which it believes to have already been synchronized (by observing that the source and destination file's size and mtimes match). cpdup does not cross mount points in the source but may cross mount points in the destination. As a safety measure, cpdup refuses to replace a destination directory with a file.

The following options are available:

-v[vvv]
    Set verboseness. By default cpdup does not report its progress except when asking for confirmation. A single -v will only report modifications made to the destination. -vv will report directories as they are being traversed as well as modifications made to the destination. -vvv will cause all files and directories to be reported whether or not modifications are made.

-f  Forces file updates to occur even if the files appear to be the same.

-i0 Do not request confirmation when removing something.

-q  Quiet operation

-o  Do not remove any files, just overwrite/add.

-m  Generate and maintain an MD5 checkfile in each directory on the source and do an MD5 check on each file of the destination when the destination appears to be the same as the source. If the check fails, cpdup the source is recopied to the destination. When you specify a destination directory the MD5 checkfile is only updated as needed and may not be updated even if modifications are made to a source file. If you do not specify a destination directory the cpdup command forcefully regenerates the MD5 checkfile for every file in the source.

-M  Works the same as -m but allows you to specify the name of the MD5 checkfile.

-x  Causes cpdup to use the exclusion file ".cpignore" in each directory on the source to determine which files to ignore. When this option is used, the exclusion filename itself is automatically excluded from the copy. If this option is not used then the filename ".cpignore" is not considered special and will be copied along with everything else.

-X  Works the same as -x but allows you to specify the name of the exclusion file. This file is automatically excluded from the copy. Only one exclusion file may be specified.

DIAGNOSTICS
The cpdup utility exits 0 if no modifications were made, and >0 if modifications were made to the destination.

SEE ALSO
cp(1), cpio(1), tar(1),

HISTORY
The cpdup command was original created to update servers at BEST Internet circa 1997 and was placed under the FreeBSD copyright for inclusion in the ports area in 1999. The program was written by Matthew Dillon and Dima Ruban.