My solution for this problem when I have to copy all the files (including .
files) to a target directory retaining the permissions is: (overwrite if already exists)
yes | cp -rvp /source/directory /destination/directory/
yes
is for automatically overwriting destination files,
r
recursive,
v
verbose,
p
retain permissions.
Notice that the source path is not ending with a /
(so all the files/directory and . files are copied)
Destination directory ends with /
as we are placing contents of the source folder to destination as a whole.