Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/clojure/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git 使用Cron作业的BitBuket自动拉取_Git_Ubuntu_Amazon Ec2_Cron_Bitbucket - Fatal编程技术网

Git 使用Cron作业的BitBuket自动拉取

Git 使用Cron作业的BitBuket自动拉取,git,ubuntu,amazon-ec2,cron,bitbucket,Git,Ubuntu,Amazon Ec2,Cron,Bitbucket,我试图每分钟创建CronJob来git pull,以使我的QA环境保持最新 git拉取需要由系统用户完成。在.git存储库中,我使用用户名和密码配置了远程源 https://{username}:{password}@bitbucket.org/{projectname}/project.git 在Cornjob中,我确实编写了以下每分钟运行的代码 */1 * * * * su -s /bin/sh nobody -c 'cd /var/www/project && /usr/

我试图每分钟创建CronJob来
git pull
,以使我的QA环境保持最新

git拉取需要由系统用户完成。在.git存储库中,我使用用户名和密码配置了远程源

https://{username}:{password}@bitbucket.org/{projectname}/project.git
在Cornjob中,我确实编写了以下每分钟运行的代码

*/1 * * * * su -s /bin/sh nobody -c 'cd /var/www/project && /usr/bin/git pull -q  origin branchname'
执行后,它显示以下错误

error: insufficient permission for adding an object to repository database .git/objects
fatal: failed to write object
fatal: unpack-objects failed

有人能帮我吗

用户
没有人
无权访问
/var/www/project
。在具有的用户下运行该命令。或者给用户
任何人
必要的权限


或者更好的是,在bitbucket上配置一个web钩子,通知您更改;这样你根本不需要投票。

我已经投票了,因为这是正确的答案,但我希望我可以再次投票,因为第二部分是正确的问题。给用户任何必要的权利。它正在工作。谢谢,博士。