Preserve macOS tags for cloud sync services

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

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.
juangamnik
 
Posts: 4
Joined: Mon Nov 21, 2016 8:11 am

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.
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

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)
juangamnik
 
Posts: 4
Joined: Mon Nov 21, 2016 8:11 am

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?
juangamnik
 
Posts: 4
Joined: Mon Nov 21, 2016 8:11 am

Not without a script but I think that really, addressing this problem is better done by using a service that can handle this info.
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

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.
juangamnik
 
Posts: 4
Joined: Mon Nov 21, 2016 8:11 am


Return to Support