Is it possible to copy files from various subdirectories to one single directory. For example I have a structure that looks like:
+ dir1
+ file1.ext
+ file2.ext
+ dir2
+ file3.ext
+ file4.ext
+ subdir
+dontwanttocopy.ext
Currently I am using the following command
find "//mysourcepathdirectory/" -maxdepth 2 -type f -name "*.ext" -exec rsync -vr -e ssh {} user@server:/mypath/videos/ \;
This command of course cause me to log repeatedly to the server. I would like a command that require me to login only one time. I am using an SSH key to avoid the pain but something is telling me that this is not the right approach. I would like to use rsync because only a few files will change over time. Also I would like to avoid copying files in subdirectories below my main path (e.g., subdir in the example above)