Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to use rsync (as a user) from "me" on a local computer to "another" user on a distant computer. However, I also want "another" user (on the distant computer) to own the files and to be able to use them exactly as "me" (on the local computer).

I believe I should play with the options: -p (preserve permissions), -g (preserve groups) and -o (preserve ownership), but I'm not sure of the exact effect of those. Which one(s) shall I use?

share|improve this question

1 Answer 1

It's probably easier to use "-a", which copies the files in "archive mode" (keeping permissions, links etc.).

If you use ssh as the shell, then the ownership etc. will happen by default:

rsync -a -e "ssh -l remote_user" hostname:remote_folder/ local_folder

You need to do this two ways, to copy local files to remote and vice verse.

(Personally, I'm not quite happy using rsync to do this, since there can be problems if both people have edited a file etc. I'm sure there are ways around this, but I've taken to using a subversion repository and an automated script to synchronise files.)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.