rsync icon indicating copy to clipboard operation
rsync copied to clipboard

rsync --chmod doesn't fully support chmod(1) mode syntax

Open steepnought opened this issue 1 year ago • 1 comments

According to the rsync 3.3.0 manpage, rsync --chmod should follow the normal parsing rules specified in the chmod(1) manpage. This is not quite true as the following doesn't work:

$ rsync -av --chmod=g=o,o= testfile1 testfile2
rsync: Invalid argument passed to --chmod (g=o)
rsync error: syntax or usage error (code 1) at main.c(1782) [client=3.3.0]

The intention here is to copy the permissions from others to group (g=o), then clear others' permissions (o=).

chmod(1) supports this (POSIX calls it permcopy).

steepnought avatar Dec 08 '24 14:12 steepnought

I was having the same issue but was able to do --chmod=u=rw,--chmod=g=r,--chmod=o=r as a workaround. I wonder if using multiple --chmod flags would solve your use case too.

Kevin5025 avatar Nov 10 '25 17:11 Kevin5025