Macos – Rsync fails for files that start with underscore when destination is zfs

backupcommand linemacosrsynczfs

I'm using rsync3.1.0pre1 on Mac OS X 10.8.5, and am trying to rsync one folder to another. The destination is a ZFS volume mounted via SMB.

The problem I'm having is that files that start with underscore (e.g., '_filename.jpg') are not being successfully synced to the destination. I get the following error message:

rsync: mkstemp "/path/to/destination/._filename.jpg.NUgYJw" failed: Permission denied (13)

In this case, _filename.jpg does not make it to the destination.

I understand that rsync creates hidden, temporary files at the destination which are preceded with . and have a random file extension appended on the end. But the original filename starts with _, not ._, and I haven't asked rsync to copy extended attributes / resource forks over (unless it always does it).

The rsync command I'm using is:

rsync -av --exclude='.DS_Store' --exclude '.Trash' --exclude 'Thumbs.db' --exclude '._*' --delete /source/ /destination/

Has anyone found a way around this problem? Thank you!

Best Answer

From the original poster, question revision 3:

We found the answer (Dave Veffer did). The smb server was vetoing ._*. Simply had to remove that from smb.conf. I'm using SMBUp on OS X. smb.conf is located at /opt/local/etc/samba3/smb.conf