So, Replace existing duplicate files on APFS with clones is really the heart of a question I really want answered, and rather than re-ask, I think the right approach would be to add maybe a 1-200 rep bounty on it. (I think? this would be my first time placing a bounty here.) But I'd like to elaborate on what, exactly, my criteria for winning said bounty would be, so I was thinking of maybe doing something like this below:
I really would love an answer too. Specifically, it would be amazing if there were a way to:
- (Quickly?) traverse an APFS filesystem (
mdfind?), comparing files by size hash (similar to trimtrees.pl (used for hard linking duplicates).
- (Safely) making clones of identical files (like with
cp -c), BUT
- Somehow preserving each file's individual metadata (ownership, modification dates, extended attributes, ACLs), while preserving the linked/cloned status of the data.
I like the idea of using a temporary SQLite database (as in the "alpha quality" implimentation below), but I'd rather it just be using the system's own facilities (no Python 3).
Is this an appropriate this to do, editing the question like that? Or should I just ask a new one? Or...?