restic icon indicating copy to clipboard operation
restic copied to clipboard

Support for nodump attribute

Open fvasco opened this issue 2 years ago • 3 comments

We currently configure exclusion list using the nodump attribute, a standard file attribute on btrfs/ext* filesystem.

Excluding file using a per-file attribute is different than other supported method:

  1. it does not restrict file name
  2. it does not force to put a flag-file in a folder
  3. it does not require a central "gitignore" file
  4. it is already used by other backup tool (ie: Borg Backup).

fvasco avatar Feb 14 '23 21:02 fvasco

Good idea! I would like to have it, too!

Framsfex avatar Feb 23 '23 17:02 Framsfex

This looks perfectly reasonable as a feature. Some preliminary implementation hints:

From what I gather, you can only determine this attribute using a statx(2) call. Go's x/sys/unix has this as Statx. Statx takes an open directory and a filename as input, not a path. So if we would reimplement internal/fs.Local.Lstat using statx, we'd need to open the parent directory and reimplement os.Lstat's cross-platform way of handling file modes. We could also do both an os.Lstat and a unix.Statx, but that comes at the cost of an additional system call and a race condition. I guess the race condition isn't that bad, so the latter way may be preferable for a first shot at this.

greatroar avatar Mar 03 '23 11:03 greatroar

Related to https://github.com/restic/restic/issues/4076 .

MichaelEischer avatar Jul 04 '24 19:07 MichaelEischer