I found this solution after googling here but I was horrified: too complicated solution. I am pretty sure some cp -versions have flags for this or just simple find
will do. So how do you copy files, not directory structure, in Unix?
find path-to-source-file-tree -type f -exec cp {} path-to-target-dir \;
That should take care of all your issues.
To customize it further you can refer: man find
For example, based on date and time, file types, file owners, etc. you can customize the above statement.