Bonus: FreeBSD is currently considering adding Rust to their base system. They have ZFS natively in FreeBSD already. Perhaps OP will find joy in FreeBSD :D
Though this has the convenience of being a more universal solution.
One idea behind my implementation was to have something that’s more agnostic of specific file systems. But I guess that’s an aspect that may be worth to reconsider.
--roll-forward=<ROLL_FORWARD> traditionally 'zfs rollback' is a destructive operation, whereas httm roll-forward is non-destructive. httm will copy only files and their attributes that have changed since a specified snapshot, from that snapshot, to its live dataset...
One of more difficult problems I had to deal with was hardlink resolution. Basically I still have to scan the whole dataset, and create a map of hardlinks before any run.I should probably look into that at some point → https://github.com/jotaen/snapdiff/issues/2
I get what you mean by "entropy", but wouldn't it be more direct to just say matching hashes will have their file sizes compared as a remedy to the collision?
Thanks for the effort, the "back yard diy" utilities are great for learning, especially with an accompanying article.
> For some extra safety margin to avoid collisions, by the way, `snapdiff` also takes the file size into consideration when comparing files.
Previously, I've used Beyond Compare 4 by Scooter Software (GUI, free to try), it's nice to have more options because diff -r doesn't get you very far.
I also like the ability to find duplicate images or any files regardless of location with Czkawka (Github qarmin/czkawka).
I agree with you on Python, but I also want to add Javascript. Just remembering trying to install something from npm sends shivers down my spine. Never again.
If you make it solid archive and sort files by extensions and enable max compression with ppm, then these backups will be some of the most efficient possible.
Out of curiosity, I setup two directories where the second has a new file, a modified file, and a removed file compared to the first:
$ tree dir1/ dir2/
dir1/
├── empty.txt
├── modified.txt
├── remove-this.txt
└── unchanged.txt
dir2/
├── empty.txt
├── modified.txt
├── new-file.txt
└── unchanged.txt
Then `git diff --name-status dir1 dir2` outputs the following, showing the changes by file name. $ git diff --name-status dir1 dir2
M dir1/modified.txt
A dir2/new-file.txt
D dir1/remove-this.txt
This also doesn't require running `git init` on the two directories either, so it's immediately usable out of the box.It’s certainly an interesting debate whether to use a general-purpose approach vs creating a dedicated and fully customisable implementation. In this case, I was interested in the exact numbers and output structure that snapdiff produces. I’m not sure what it would take to make the same output happen by using git, or how well that would work on directory sizes in (or beyond) the 100.000 files / 100 GB region.
If someone would be up for trying that out and sharing their insights, I’d be interested to learn about it.