rsync – Why rsync is Changing Directory Permissions

rsync

I have an rsync setup that transfers files from my local development machine to my production web server. On the production server, the storage directory needs to be 775.

When the rsync completes, it gets changed to 755

Best Answer

From man rsync:

-p, --perms                 preserve permissions

Assuming that you want to preserve all metadata and not just permissions, you probably want to use -a with -HAX, which implies -p.

-a, --archive               archive mode; equals -rlptgoD (no -H,-A,-X)
Related Question