I set a CentOS to run our company website using Apache. Apache runs as user apache
. Now, to update our website code using git, I set a user say sumit
, and create a shell script that does git pull
(I think we can use rsync
, but I am not sure how to use it).
Now, I set this shell script to run in timely manner, and it works fine. however when it download the changes it change the owner of file form apache:apache
to sumit:sumit
as that is the user it download with. I try to put chown
in my shell script but it doesn't change user as it requires sudo
user.
How can I ensure that using git
1. I can manage permission (so all writable folder do not change or stick to my need)
2. new files that get downloaded remain for apache.
Oh, I did try to run cron using apache
user, but that didn't work as apache
is banned from shell.