The [XDG base directory spec](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html) has a place to cache things (e.g. `$XDG_CACHE_HOME`/`$HOME/.cache`). You probably want to [stay away from `/tmp`](https://mastodon.social/@encukou/111759108456279931) as it may be too small to use if you have a large dependency like tensorflow due to it sometimes being a ramdisk. A [`CACHEDIR.TAG` file](https://bford.info/cachedir/) is meant to signal that a directory is not to be backed up. The should: 1. Start with `Signature: 8a477f597d28d172789f06886806bc55` (which is `hashlib.md5(b".IsCacheDirectory").hexdigest()`) 2. Can have comments starting w/ `#` **after** the `Signature` block 3. e encoded in UTF-8 For macOS, [someone pointed out](https://hachyderm.io/@ossmkitty/111767331018057357) that the extended attribute `com.apple.metadata:com_apple_backup_excludeItem` -- which can be set via [`tmutil addexclusion`](https://ss64.com/mac/tmutil.html) -- can be used to keep something from being backed up.