I was trying to create a cronjob with a task to do a git pull every minute to keep my production site in sync with my master branch.
The git pull needs to be done by the system user nobody, due to the permissions problem. However it seems that the nobody account is not allowed run commands. So I have to create tasks as the root user.
The crontab entry I tried:
*/1 * * * * su -s /bin/sh nobody -c 'cd ~heilee/www && git pull -q origin master' >> ~/git.log
It doesn't work, and I don't know how to debug it.
Could anyone help?
UPDATE1: the git pull command itself is correct. I can run it without errors.
git.log?... >> /var/log/git.loggit pullautomatically runsgit mergewhich may fail with conflicts, and leave things in a state that is non-trivial for an automated script to fix, I would highly dis-recommend doing this on any repository that has even a remote chance of anything other than that one job causing updates that may prove to be incompatible. Usegit fetchinstead, and periodically do a manual merge.