This program allows one to make an exact copy of a given directory structure, ignoring all files and symlinks. If the target directory is a subdirectory of the source directory (regardless of depth), the target directory will not be mirrored.
Sometimes one wants to duplicate a large (or small) directory tree without duplicating all of the files contained in the hierarchy. This tool allows one to do this with minimal effort and acts quasi-intelligently to prevent infinite copying loops that can occur in certain situations.
To build the program, use the following command:
g++ -o dirmirror dirmirror.cpp
The syntax for dirmirror is as follows:
dirmirror <source directory> <target directory>
The source code for dirmirror is available for download below.
dirmirror was written by Adam
Jensen <ajensen at linuxguy dot org>.