Windows – rsync ubuntu to windows under cygwin – way to avoid ‘invalid argument 22’ error

cygwinrsyncUbuntuwindows

I'm doing a backup from a ubuntu server to a windows machine running cygwin. I'm using the following command:

rsync -avx --timeout=30 --delete-excluded --exclude '.git' rsync@server.com:/var/www/site/ /cygdrive/c/temp/sitebackuprsync/

Is there a way (ie a command parameter) to avoid getting the 'Invalid argument 22' errors?

edit
This is an example of one of the errors

rsync: chown "/cygdrive/c/temp/sitebackuprsync/tmp/cache/meta/f4/.3b896ab05c69a5c1da040df249f764a2fad29a.RHbrGk" failed: Invalid argument (22)

Best Answer

The -a flag to rsync includes a number of options that don't make sense on Windows; the error you're seeing indicates that rsync is trying and failing to preserve file ownership. Try using -rtvx instead of -avx.

Related Topic