I have a source folder
-rw-------@ 1 user staff 41B Mar 23 13:59 aws-1 -rw-r--r-- 1 user staff 112B Mar 23 14:36 aws-2 -rw-rw-rw-@ 1 user staff 2.3K Feb 5 17:15 google
the destination folder doesn't exist yet. And I try to rsync the 2 aws files into a destination folder. Here is my command:
rsync \ -avh --chmod=a=rw \ --include="aws-*" \ --exclude="*" \ "source/." "destination/"
What I'm trying to do is to rsync the 2 aws files and change their permissions once in the destination folder. After running the command, I got an error and the files are not in the destination folder. Only the folder is created. Here is the error:
building file list ... done created directory /Users/user/destination/aws ./ rsync: recv_generator: failed to stat "/Users/user/destination/aws/aws-1": Permission denied (13) rsync: recv_generator: failed to stat "/Users/user/destination/aws/aws-2": Permission denied (13) rsync: recv_generator: mkdir "/Users/user/destination/aws/." failed: Permission denied (13) *** Skipping everything below this failed directory ***
It says permission denied without copying the files. I don't already understand which permission cause problem. My source file and directory seems fine. The created destination folder seems also fine.
PS: I precise my rsync command happens inside a bash script