How to preserve tags

Arguably, kopia preserves most extended attributes. Here’s an excerpt of mdls output on a file of mine:

kMDItemAcquisitionMake  = "NIKON CORPORATION"
kMDItemAcquisitionModel = "NIKON D90"
kMDItemExposureMode     = 0
kMDItemExposureProgram  = 3
kMDItemFlashOnOff       = 0
kMDItemFNumber          = 4.5
kMDItemFocalLength      = 70
kMDItemFocalLength35mm  = 105
kMDItemKeywords         = (
    Landscape
)
kMDItemWhiteBalance     = 0
kMDItemISOSpeed         = 1400

As we can see, a fair amount of information is preserved.

The one thing that is missing (and that I care about) on files restored from backup is:

kMDItemUserTags         = (
    my_test_tag,
    and_some_more
)

which are Finder tags (macOS). Looking at the mdls output, I can’t see how this information is stored any differently than others. Any idea why kMDItemUserTags is left out? And more importantly, how to preserve it?

On macOS you should find some alternative to getfacl/setfacl (ls -le && chmod might be used) and run just before snapshot and save it together with snapshot, so in case you need to restore all file’s metadata, you would have its stage

Thanks for your input. Although I’m not that concerned about ACLs, you are right: I could dump mdls output to a file that would also be backed-up by kopia.

Brett Terpstra had a tool to do something similar, precisely for Finder tags. That’s from ten (10!) years ago, though.

I think I’ll reach out to him and see what his current solution is.