Page 1 of 1

Preserve macOS tags for cloud sync services

PostPosted: Mon Nov 21, 2016 1:32 pm
by juangamnik
I use different cloud services (ownCloud, WD My Cloud), but have issues syncing macOS tags as they are attributes in HFS+. Time Machine backups don't have the problems as they are stored in a `sparsebundle` image file with HFS+ file systems. But the normal sync folders are not and normally these services use WebDAV for transport, which is not aware of these attributes.

I could store a sparsebundle in the sync folder, too. But most of these services cannot do differential syncing (like rsync and zsync can). So each time I change something in the sparsebundle, the complete image would be transferred. More importantly, this would not work with more than one client, as each change to any file, would create a conflict on the complete sparsebundle.

My hope is, that I can somehow use hazel to store the tags somewhere in the xattributes or something similar and automatically restore them to macOS tags, when the file has been updated (due to a sync from a change on another device).

Is this possible and if yes, how?

Thank you very much in advance.

Re: Preserve macOS tags for cloud sync services

PostPosted: Tue Nov 22, 2016 1:20 pm
by Mr_Noodle
I think a function like this is outside of Hazel. Note that tags are already stored in xattrs. You just need to find a service that will back those up properly. It will be far better doing that than trying to roll your own solution.

Re: Preserve macOS tags for cloud sync services

PostPosted: Tue Nov 22, 2016 1:28 pm
by juangamnik
Mr_Noodle wrote:I think a function like this is outside of Hazel. Note that tags are already stored in xattrs. You just need to find a service that will back those up properly. It will be far better doing that than trying to roll your own solution.


The issue is, that the tags are HFS+-only :(

Do you know a service like that? I'm already using ownCloud and WD Cloud, and would need a service, that listens to file system events on my client and do this. I thought that Hazel is doing exactly such things. Why do you think it is not adequate?

I tried to use one folder per tag and make a hard link for each file to each of its tag folders, but the sync services "split" the link on change, so this is no solution (although AFAIK, this would be something that hazel could do for me too, right?... creating a hard link for each tag)

Re: Preserve macOS tags for cloud sync services

PostPosted: Tue Nov 22, 2016 2:39 pm
by juangamnik
I found a solution for git here:

http://info.michael-simons.eu/2013/10/2 ... -with-git/

wouldn't it be possible to use hazel to read in metadata of all files in a folder and store it to a `.metadata`-file (perhaps this can be done on a per file basis, too) and restore them as soon as a file change (e.g. due to a sync) occurs?

Re: Preserve macOS tags for cloud sync services

PostPosted: Wed Nov 23, 2016 1:34 pm
by Mr_Noodle
Not without a script but I think that really, addressing this problem is better done by using a service that can handle this info.

Re: Preserve macOS tags for cloud sync services

PostPosted: Thu Nov 24, 2016 5:46 pm
by juangamnik
Mr_Noodle wrote:Not without a script but I think that really, addressing this problem is better done by using a service that can handle this info.


I would write a script not an issue.

But using another service is not an option (for me) as I don't want to store my data at Dropbox or iCloud.