unison
unison copied to clipboard
Support ignoring cache directories following the Cache Directory Tagging Specification (CACHEDIR.TAG)
The Cache Directory Tagging Specification is a specification that provides applications the ability to mark their cache directories by putting in a file called CACHEDIR.TAG
with the content Signature: 8a477f597d28d172789f06886806bc55
. These files can then be recognized by backup or synchronization tools so that they can skip the cache files.
Some Software that creates CACHEDIR.TAG
files already:
- Rusts
cargo
package manager - pytest and mypy
- fontconfig
Some Archiving/Backup software that have options to exclude cache direcories:
- GNU tar
- Borg backup
It would be great if unison had a configuration option to ~~support this~~ automatically ignore cache directories following this specification. Especially with rust target
directories being easily in the gigabytes.
What do you mean by "support this"? Should unison put such a marker in its own .unison
directory where the archives live? Or should it provide an option to automatically ignore directories with that marker?
Or should it provide an option to automatically ignore directories with that marker.
^ This, an option to support automatically ignoring directories with that marker.
Tagging .unison
probably wouldn't be such a good idea because it not only contains the archive files but also the profiles, which are more than just caching.
This seems reasonable to me.
The only question is whether it needs to be a preference or if cachedirs should always be ignored. I suspect some people do want them synced, but maybe there are no such people.
If unison was starting from a clean slate it would probably be a good idea to make this a default, but as it stands I don't think anybody is expecting that an update suddenly stops synchronizing some directories without asking, so it should probably be opt-in instead of opt-out/unconditional.
What might be worth looking into is automatically adding the option for new profiles but leaving existing profiles as they are.
Good point about unexpected changes. I lean to less magic so default-off new option seems good. Happy to have discussion on unison-users about the details when/if a mergeable PR materializes.