0

I'm having trouble transferring files via ssh from a Windows box to an Ubuntu box using rsync and cygwin on Windows. The file transfer starts, but the newly created directories and files on the server side always get created without user permissions. Thus, any further attempt to write into a directory or subdirectory returns one of numerous "Permission denied (13)" errors from rsync. What's the correct syntax I should use? Do I need to have a more explicit rsyncd.conf file?

On the Windows side, I'm issuing this command:

Patrick@ELWAH P:\Music
> rsync -avz --progress -h ./iTunes [email protected]:/mnt/largemarge

On the server side, it's creating directories with permissions as follows:

patrick@Ceres:/mnt/largemarge$ ll
total 12
drwxr-xr-x 3 patrick patrick 4096 Jul  1 22:16 ./
drwxr-xr-x 3 root    root    4096 Jul  1 20:23 ../
d---rwx--- 5 patrick patrick 4096 Jul  1 21:52 iTunes/
patrick@Ceres:/mnt/largemarge$

And the output from Windows eventually produces errors such as:

Patrick@ELWAH P:\Music
> rsync -avz --progress -h ./iTunes [email protected]:/mnt/largemarge
[email protected]'s password:
sending incremental file list
rsync: recv_generator: mkdir "/mnt/largemarge/iTunes/Album Artwork/Cache" failed: Permission denied (13)
*** Skipping any contents from this failed directory ***
iTunes/Album Artwork/
iTunes/Album Artwork/Cache/
rsync: recv_generator: mkdir "/mnt/largemarge/iTunes/Album Artwork/Cloud Purchases" failed: Permission denied (13)
*** Skipping any contents from this failed directory ***
iTunes/Album Artwork/Cloud Purchases/
rsync: recv_generator: mkdir "/mnt/largemarge/iTunes/Album Artwork/Download" failed: Permission denied (13)
*** Skipping any contents from this failed directory ***
iTunes/Album Artwork/Download/
rsync: recv_generator: mkdir "/mnt/largemarge/iTunes/Album Artwork/Remote" failed: Permission denied (13)
*** Skipping any contents from this failed directory ***
rsync: recv_generator: mkdir "/mnt/largemarge/iTunes/Previous iTunes Libraries" failed: Permission denied (13)
*** Skipping any contents from this failed directory ***
rsync: recv_generator: mkdir "/mnt/largemarge/iTunes/iTunes Media" failed: Permission denied (13)
*** Skipping any contents from this failed directory ***
iTunes/Album Artwork/Remote/
iTunes/Previous iTunes Libraries/
iTunes/iTunes Media/

sent 2.10M bytes  received 13.33K bytes  103.31K bytes/sec
total size is 332.36G  speedup is 156,927.14
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1165) [sender=3.1.1]
1
  • Please add the output of ls -ld iTunes to understand as cygwin which are the permission on the windows side
    – Hastur
    Commented Jul 2, 2015 at 6:00

1 Answer 1

1

rsync's -a option is actually an alias for (according to the manpage) -rlptgoD. The -p in that list is for "preserve permissions"; i.e., rsync will do stat() on the source file and copy the permission bits to the destination file.

Since windows doesn't have any unix permissions, cygwin has to come up with an approximation, which necessarily is somewhat limited. If you just don't ask rsync to copy the permissions, it will create files and directories with default permission bits, and the problem shouldn't exist.

Note that -g and -o stand for "preserve group" and "preserve owner", respectively, which you might want to exclude as well, for similar reasons.

Your entire command therefore becomes:

rsync -rltvzD --progress -h <source> <destination>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .