rsync: --groupmap=*:www-data: unknown option

I am trying to add an option to my rsync line to set the group of the files transfered to have www-data as their group.

When i add the option i get the above message.

Here is the rsync line i am trying:

rsync -avz --delete  --chmod=ug=rwX,o=rX  --groupmap=*:www-data ' -e "ssh -p 48"  /cygdrive/e/test  john@my.domain.com:/var/vhost/locals/test

Without the -groupmap flag the files are landing as john:john instead of the desired jonh:www-data.

This is from windows to ubuntu.

Does anyone have any ideas?

it is the same when i try to use --chown:

rsync: --chown=john:www-data: unknown option

ref: http://rsync.samba.org/ftp/rsync/rsync.html


The options you reference were included in Version 3.1.0 of rsync, but it looks like you are using cygwin on Windows, which may not have had this version until June-2014.

Given the proximity to your question, you are likely using an older version of rsync. Perhaps you just need to upgrade to the latest cygwin/rsync?

rsync --version

The quickest way to solve this is to reverse into Windows. If you rsync on Ubuntu from Windows you should be able to set permissions there.

  • The permissions are fine, it is the owner:group aka the chown which is wrong. The files are going in as john:john instead of john:www-data i need to be able to do this via the rsync command and not have to chown the directory after each rsync as this is for a development build. – John Jul 25 '14 at 8:42
  • as in, the dev hits save, this rsync is run, the dev checks new file on dev server... if the dev has to log in all the time to chown the files that would get irritating – John Jul 25 '14 at 16:39

I gave up. A work around was to run apache as john:www-data. The rsync copies new files to the destination as john, but apache can read them fine as running as john:www-data.

<IfModule mpm_itk_module>
AssignUserId john www-data

rsync version 3.1.2

I mostly use windows in local, so this is the command line i use to sync files with the server (debian) :

user@user-PC /cygdrive/c/wamp64/www/projects

$ rsync -rptgoDvhP --chown=www-data:www-data --exclude=.env --exclude=vendor --exclude=node_modules --exclude=.git --exclude=tests --exclude=.phpintel --exclude=storage ./website/ username@hostname:/var/www/html/website

I hope this will be helpful for you

  • 1
    :) at the time of writing this i was on windows and the chown option did not work. I have long since ditched windows and moved to linux. – John Oct 17 '18 at 15:09
  • @John for me it work just fine!! – chebaby Oct 17 '18 at 15:22
  • cygwin must have upgraded the version of rsync since then. – John Oct 17 '18 at 15:39
  • John, i came from a google research, so i put the answer for future users that may have the same problem. – chebaby Oct 17 '18 at 16:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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