I'm trying

rsync -rltzogvpE --chmod -x,ug=rwX,o= <more_args...>

But my files are arriving with the executable bit set.

However, when I do

chmod -R -x,ug=rwX,o= .

In the same directory, after the upload is complete, the x bit is removed off all the files (like I want).

How can I get rsync to remove the x bit for me, without issuing a 2nd command?

1 Answer 1


According to the rsync manual, rsync --chmod can take different rules for directories and for files. So if you don't need to consider executable files, but just want the x-bit set for directories and unset for files, you should be able to use

rsync --chmod D770,F660

In addition to the normal parsing rules specified in the chmod(1) manpage, you can specify an item that should only apply to a directory by prefixing it with a D, or specify an item that should only apply to a file by prefixing it with a F.

Didn't test it, though.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .