Tarsnap / tarsnap

Command-line client code for Tarsnap.
https://tarsnap.com
Other
853 stars 59 forks source link

Optional support for CACHEDIR.TAG files #509

Open vikanezrimaya opened 2 years ago

vikanezrimaya commented 2 years ago

Relevant specification: https://bford.info/cachedir/

This is a feature request for an optional configuration flag, named exclude-cachedirs (name might be changed at the discretion of impelementors), that would automatically exclude any directory containing a file named CACHEDIR.TAG with the first 43 octets consisting of the following ASCII string verbatim: (the aforementioned string is sourced from the official specification linked above, read it for more info)

Signature: 8a477f597d28d172789f06886806bc55

This tag is used by several utilities, including the Rust package manager Cargo, to mark directories that do not require any sort of backup and only contain cache data (or easily reproducible data). While one could set a nodump attribute on it, Cargo (and other utilities adhering to the specification) already express their recommendation in form of the aforementioned tag file, therefore optional support for it might prove beneficial for Tarsnap.

cperciva commented 2 years ago

I like the concept, but I wish it were more widely used. You mention Cargo; the only place it's used on my system is fontconfig. By far the biggest caches on my system are from Thunderbird and Chromium, neither of which implement this.

I'm not saying no, but I have to admit that I'm a bit dubious about a specification from 2004 which is so sparsely used.

vikanezrimaya commented 2 years ago

Understandable. Thankfully, this is a fairly low-priority issue for me - I don't have a lot of folders like this inside of folders that do need to be backed up, and as such I specify them manually for now.