I'm making a script sync a local folder with a remote one from a NAS, the folder has been mounted into OS X with the NAS administrator name and password.

The script is:


/usr/bin/sudo /usr/bin/rsync -rav --delete --exclude=".*" /path-to-origin/ /Volumes/NAS/path-to-destination/

The script must be executed by a user called Auser so I call the script from the command line this way:

sudo -u Auser script-to-rsync.sh

And the reply I get in Terminal is:

building file list ... done
rsync: chgrp "/Volumes/NAS/path-to-destination/." failed: Operation not permitted (1)
rsync: chgrp "/Volumes/NAS/path-to-destination/file.ext" failed: Operation not permitted (1)
rsync: chgrp "/Volumes/NAS/path-to-destination/." failed: Operation not permitted (1)

sent 311 bytes  received 62 bytes  746.00 bytes/sec
total size is 53864490174  speedup is 144408820.84
rsync error: some files could not be transferred (code 23) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-47/rsync/main.c(992) [sender=2.6.9]

I'm sure it's a permissions issue, so I've tried to change the owner of the destination folder to Auser without success:

sudo chown fmserver /Volumes/NAS/path-to-destination/

And I get:

chown: /Volumes/ombacap/om15/copies/: Operation not permitted
  • What version of macOS are you using? – tubedogg Oct 13 '16 at 16:56
  • @tubedogg El Capitan – naio Oct 13 '16 at 16:57
  • Does your NAS offer rsync services? An NAS has it's own operating system that shares files with other computers. You can't chown or chmod from a connected computer unless the NAS allows you to. – fd0 Oct 13 '16 at 18:36

Many foreign file systems (such as the Windows-native ones like FAT16/FAT32 etc) do not have a concept of file ownership on the filesystem level, and so the system call to change the owner is blocked with an error message.

You must log in to answer this question.

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