5

I'm trying to sync a directory tree from OS X (10.11) to Ubuntu 14.04. While most of the files get transferred just fine, files with names starting with _ (underscore) do not.

Here is the command I use:

rsync -rtvh --progress ~/Pictures/processed/ ~/mnt/processed/

And an example of the output:

sending incremental file list
_MG_7425.jpg
      4.66M 100%  169.79MB/s    0:00:00 (xfr#1, to-chk=58/60)
_MG_7427.jpg
      6.59M 100%  103.07MB/s    0:00:00 (xfr#2, to-chk=57/60)
...
rsync: mkstemp "/Users/user/mnt/processed/._MG_7425.jpg.0cAYb3" failed: No such file or directory (2)
rsync: mkstemp "/Users/user/mnt/processed/._MG_7427.jpg.5Gw1vD" failed: No such file or directory (2)

sent 306.24M bytes  received 9.46K bytes  122.50M bytes/sec
total size is 306.17M  speedup is 1.00
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1249) [sender=3.1.2]

My rsync is installed from homebrew, version info:

rsync  version 3.1.2  protocol version 31
Copyright (C) 1996-2015 by Andrew Tridgell, Wayne Davison, and others.
Web site: http://rsync.samba.org/
Capabilities:
    64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,
    socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace,
    append, ACLs, xattrs, iconv, symtimes, no prealloc, file-flags

The remote location is mounted using sshfs:

sshfs -o idmap=user username@hostname:/some/path ~/mnt -o auto_cache,reconnect,defer_permissions,noappledouble

Copying one of the skipped files using cp command succeeds. I tried adding --iconv=utf-8-mac,utf-8 and --include '_*' options which had no effect.

What am I doing wrong?

Nic Nilov
  • 191
  • 1
  • 8
  • 2
    To rule it out, I would avoid sshfs. It's dogdy in my experience. If you have SSH access, you can rsync over ssh directly. – Halfgaar Jan 04 '17 at 19:04
  • Thanks for pointing out to the sshfs, that did it. I realize rsync does not need sshfs but I wanted to figure out the source of the issue. – Nic Nilov Jan 04 '17 at 19:54
  • In case someone found this while search for similar issue with cryptomator, see https://github.com/cryptomator/cryptomator/issues/802#issuecomment-475937418 – kenchew Jun 28 '21 at 04:16

1 Answers1

4

It turns out the culprit was in the sshfs flags. The noappledouble flag I was using to get rid of .DS_Store files was actually interfering with rsync's work.

From the sshfs Mount Options docs:

noappledouble

This option makes osxfuse deny all types of access to Apple Double (._) files and .DS_Store files. Any existing files will become apparently non-existent. New files that match the criteria will be disallowed from being created.

As it points out, the option is also concerned with the ._ name prefix, which is exactly what rsync happened to use for its temporary files:

rsync: mkstemp "/Users/user/mnt/processed/._MG_7425.jpg.0cAYb3" failed: No such file or directory (2)

Thus, when mkstemp was creating the temporary file, sshfs interfered and blocked it's creation.

Removing noappledouble option from the sshfs mounting command fixed the issue and the _* files have been transferred fine.

Thanks to @Halfgaar for pointing me in the right direction.

Nic Nilov
  • 191
  • 1
  • 8