I have a dilemma... to automate deployment of a web site from our development server (Windows) to our live server (centros linux) I'm using cwrsync on the Windows side to send it over. The problem is that the permissions are all wrong. My only hope is to get rsync to recognize a umask on my server and adhere to that... but it's not happening! Can anybody tell me where I'm going wrong?
What I need is for the directories to be chmodded to 755 and individual files to be 644 when they're created on the linux side.
Here's what I have setup... first, here's my rsync command from Windows (censored the username and ip address):
I've tried adding
to that but it can't write in the directories it creates... can create directories though. -p option hasn't helped one bit either.
On the linux server, previously I didn't have umask set in either my /etc/bashrc or /etc/profile. It wasn't in the user's .bashrc or .bash_profile files either. So I added this to /etc/bashrc:
and restarted ssh just in case, but no luck. Tried adding this additionally to /etc/profile:
...restarted ssh (via /sbin/service sshd restart) and no luck.
I'm really stuck here and honestly I feel like I'm missing some fundamental reason this isn't working, like I'm not restarting something correctly. Does anybody know what I'm talking about and what the problem may be? I'm happy to provide additional info if needed.
Thank you very much in advance,
- Mike
What I need is for the directories to be chmodded to 755 and individual files to be 644 when they're created on the linux side.
Here's what I have setup... first, here's my rsync command from Windows (censored the username and ip address):
Code:
"c:\program files (x86)\cwrsync\bin\rsync" -rtvz --rsh='"/cygdrive/c/program files (x86)/cwrsync/bin/ssh" -p20880' ./Mysite.com/ [email protected]:~mysite/
Code:
--chmod u=rwx,g=r,o=r
On the linux server, previously I didn't have umask set in either my /etc/bashrc or /etc/profile. It wasn't in the user's .bashrc or .bash_profile files either. So I added this to /etc/bashrc:
Code:
if [ $UID -gt 99 ] && [ "`id -gn`" = "`id -un`" ]; then
umask 002
else
umask 022
fi
Code:
umask 002 # Proper functioning of rsync from windows
I'm really stuck here and honestly I feel like I'm missing some fundamental reason this isn't working, like I'm not restarting something correctly. Does anybody know what I'm talking about and what the problem may be? I'm happy to provide additional info if needed.
Thank you very much in advance,
- Mike
Last edited: