简体   繁体   中英

What is the correct way to setup linux users & groups when multiple users rsync to the same remote location?

I have multiple developers trying to rsync files (symfony php projects) to the same remote location. This has been setup as follows:

  • Each user has their own login on the remote server
  • Each user is a member of the same group on the server, say "mygroup"
  • Files locally and at the rsync destination are owned by a user and the group. Eg someuser:mygroup

As far as I am aware you must own a directory in order to set its access and modification times to an arbitrary value, being a member of the owning group is not enough. For this reason if user A tries to rsync directories owned by user B rsync outputs the following errors:

 rsync: failed to set times on "/some/path": Operation not permitted (1)
 rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1058) [sender=3.0.5]

So, what is the correct way to setup users & groups when multiple users rsync to the same remote location?

What Let_Me_Be said then deploy from Git (or Mercurial) to testing or staging then rsync from there to live. Better still use something like Hudson/Jenkins to manage the whole shooting match for you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM