I have a software project that uses a specific directory structure for configuration files. Symlinks are used to point to the config files currently in use. I'm in the process of making a custom installer script for CentOS 7.
I use another script to bundle the directory structure and the installer script. The bundle script uses rsync to copy the directory structure with all default symlinks intact. It also excludes the hidden svn folders.
rsync -a --exclude=".*" [sourceFolder] [bundleFolder]
The install script uses cp to install the directory structure (default symlinks intact) to the user specified location.
cp -rP [bundleFolder] [installLocation]
This all works great.
However, I also need the installer script to be able to update an existing installation. The problem with this is that I need to be able to update the config files without altering the symlinks that the user has in place.
Is there a way to copy the entire directory structure (all folders and sub-folders) but ignore any symlinks? I'm trying to avoid having to use find to parse the entire structure in a bash script just to ignore the symlinks. I assumed that this would be a common task that cp or rsync would have an option for. I haven't been able to find one though.