I'm trying to copy some files into existing folders. This is an example of the schema
# origin /home/user/myfiles/folder1/group1/1.jpg /home/user/myfiles/folder1/group1/2.jpg /home/user/myfiles/folder1/group2/1.jpg /home/user/myfiles/folder1/group2/2.jpg /home/user/myfiles/folder2/group1/1.jpg /home/user/myfiles/folder2/group1/2.jpg /home/user/myfiles/folder2/group2/1.jpg /home/user/myfiles/folder2/group2/2.jpg
The destination folder schema already exists, its just the origin files (jpgs) that are not there.
My question is how to do this?
I would like to end up with something like below, but this is not working. Maybe I should include regex in the query to separate asterisk into values and use as origin/destination?
cp /home/user/myfiles/*/*/*.jpg /home2/user/myfiles/*/*/*.jpg
My original intend is to use this copying schema on my unanswered question: s3cmd: how to copy files from local to S3 bucket with existing structure as a possible solution.