Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm having problems synchronising file permissions with rsync. I'm trying to sync my /home/bin folder with the /home/bin folder on a remote machine. The problem is that when I write a new script and make it executable with 'chmod +x' then after performing rsync, the file reverts back to being unexecutable.

If I use --perms, when I update the file permissions on the remote machine and then use rsync on the host machine, the file permissions don't get updated on the host machine and on the remote machine they get reverted back.

Is there a way to properly sync the file permissions?

UPDATE: I forgot to post the script I use:


rsync -e ssh -avz --recursive --progress --update --perms /home/bin                                                                              
rsync -e ssh -avz --recursive --progress --update --perms /home
share|improve this question

I think your basic problem here is that rsync is not a good tool for two-way synchronization. I would recommend some solution conceptually different, otherwise you will keep clobbering yourself.

  • You could look into using Unison. It functions similar to rsync but is designed for two say synchronization.
  • Better yet, look into using a source control system like git. This is particularly useful for things like config files and your personal scripts. Each machine you use them on will have a separate checkout, and the versioning takes care of making sure that you always have the latest changes by time including merging multiple different changes rather than just having the data clobbered from any one source.
share|improve this answer

Your Answer


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.