Restic runs lstat on files excluded by extension - intended behaviour?

This is an architectural limitation restic currently has: some of the exclude functions (e.g. --one-file-system) need to have the information lstat returns, and so we’re currently running lstat on the files before checking the excludes. The solution would be to have two types of excludes:

  • The ones which can decide by name/path if a file is to be excluded
  • The ones which need the lstat information (e.g. --one-file-system)

Until this is implemented, restic runs lstat() on all files. Sorry about that. You could add a bug report to the GitHub issue tracker so we can track improving the exclude function, that’d help.