Please help me understand --add-ignore vs --add-dot-ignore kopia

–add-ignore vs --add-dot-ignore kopia - can somebody explain the difference?

The docs are not enough. What is the dot-ignore list? What is the use case of each of these two options? policy set | Kopia

This is a good question, and I think it is a good place to discuss this and perhaps eventually submit a PR on GitHub to clear this issue.

From my understanding, --add-ignore is a straightforward rule: ignore this file/directory. However, Kopia also supports a .kopiaignore format (see [Document the .kopiaignore format · Issue #1945 · kopia/kopia · GitHub]) file which acts very much like a .gitignore file. When placed in the snapshot path, Kopia parses the file and then determines which files/directories to ignore. Much like the aforementioned .gitignore, you can do all sorts of tricks like pattern matching, globbing, conditionals, etc. My understanding is that --add-dot-ignore appends to this list, so that you can add stuff to it using the cli interface.

The effect for simple cases using both is similar: a certain set of paths are excluded. But .kopiaignore is much less hard-coded in that it is not fundamentally tied to your repository configuration. You can nuke the file without having any changes in your repository configuration. On the other hand, --add-ignore is part of your repository configuration, but is also simpler to use since it doesn’t do all the fancy stuff that the other option does.

@jkowalski can perhaps verify/clarify this, and I can work towards maybe submitting a PR on the docs.

2 Likes