rsync deploy and file/directories permissions

Granze picture Granze · Feb 7, 2012 · Viewed 11k times · Source

I'm trying to use rsync to deploy my website that resides on a shared web host.

Phpsuexec is running on it and that caused me problems with permissions on files and directories I've transfered via rsync. Actually files should be set to 644 and directories to 755, otherwise I get a 500 error.

After several attempts, I came with this rsync command:

rsync -avz -e ssh --chmod=Du=rwx,go=rx,Fu=rw,og=r -p --exclude-from=/var/www/mylocalfolder/.rsyncignore /var/www/mylocalfolder/ [email protected]:~/

Unfortunately this command doesn't works as expected because all the sent directories have been set to 744. On the other hand, files permission have been correctly set on 644.

I can't understand what is wrong.

P.S. I use Linux on my local machine.

Answer

Shadow aok picture Shadow aok · Jul 18, 2012

Try it like this :

--chmod=Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r

It worked for me.