I'm implementing bash script to rsync all backup folders in my TimeMachine to my NAS storage in the same local network. After the rsync is completed, I tried to rsync back from NAS to my TimeMachine but failed. The error messages are as below:
rsync: delete_file: unlink
"/Volumes/TimeMachine/Backups.backupdb/kongycmac/2017-05-16-
120657/Mac OS/usr/share/man/mann/S3.n" failed: Operation not
permitted (1)
After further checked on the file permissions, I realised that the file permission for my backup folder in TimeMachine and backup folder in NAS are different, as below:
TimaMachine Backup:
drwxr-xr-x@ 4 root wheel 136 May 16 12:06 kongycmac
NAS Backup:
drwxr-xr-x 4 root root 4096 May 12 17:37 2017-05-
12-173741
What does the '@' means in TimeMachine Backup folder? What shall I do to change my folder permission in NAS backup to become drwxr-xr-x@ ?
Scratching my head in this issue for 3 days, appreciate if anyone can provide a good suggestion for this.
Check the man page for
ls
, in the "Long Format" section:The directory will also have an access control list (normally indicated by "+", but "@" takes precedence).
You can view the extended attribute(s) and ACL with
ls -l@e
. But you may not be able to replicate them on the NAS -- the ability to store various kinds of metadata are filesystem-dependent, and unless the NAS is using the Mac OS Extended (aka HFS+) filesystem, it probably doesn't support them (at lest directly). But they might be being saved anyway -- if you usersync -E
it might store them in a separate metadata file with a "._" prefix on the filename. But that'll depend on exactly how you're using rsync, what's on the NAS, etc.I'm not sure how critical the ACLs are for Time Machine backups (I think they're mostly there to keep people from messing up the structure of the backup system), but the extended attributes seem to be pretty important. If you want to be able to get the TM backup back in a form that TM can use it, you need them.
But there's actually another problem: Time Machine uses hard-linked directories, and I don't think many (any?) filesystems other than Mac OS Extended support those. This... may cause trouble.