Support "Cache Directory Tagging Standard" (already implemented e.g. in GNU tar)

Tor seems to store sizable cached data in /var/lib/tor/diff-cache/. There is now a standard for apps to indicate that transient caches like this to be skipped from backups: https://bford.info/cachedir/spec.html

The application needs to create (and recreate) a file called "CACHEDIR.TAG" in the cache directory, with content of "Signature: 8a477f597d28d172789f06886806bc55".

Skipping cache directories marked as such via this standard is already supported for example in GNU tar:

--exclude-caches Exclude contents of directories containing file CACHEDIR.TAG, except for the tag file itself.

--exclude-caches-all Exclude directories containing file CACHEDIR.TAG and the file itself.

--exclude-caches-under Exclude everything under directories containing CACHEDIR.TAG

Trac:
Username: rm