I'm trying to use rsync to copy from an Android source where the sdcard mount has rather nonsensical permissions (---rwxr-x) and rsync fails because it creates the destination directories with the same permissions, then can't create any files in them. I want it to just ignore the permissions from the source and create all files/directories honoring the current umask. --no-perms does not work (and it's the default anyway; I'm not using -a) when new files/directories are being created; it simply prevents changing permissions on files/directories that already exist.
2 Answers
Use:
--chmod CHMODFrom the rsync man page:
To give new files the destination-default permissions (while leaving existing files unchanged), make sure that the --perms option is off and use --chmod=ugo=rwX (which ensures that all non-masked bits get enabled).
rsync versione 3.0.4 -- Use the flag -p to enable permission option and define the new changed permission --chmod=g+rw.