Skip to main content

default_ignore_rules

Function default_ignore_rules 

Source
pub fn default_ignore_rules() -> Vec<String>
Expand description

The default OS-artifact exclude set for Files.ignore_rules — filesystem/NAS junk that is never intentional user data, so excluding it by default is additive-safe. Per-entry rationale:

  • /lost+found — root-anchored ext4/fsck recovery dir. Anchored (leading /) so a nested user directory named lost+found is left alone; only the source root’s own fsck dir is excluded.
  • System Volume Information, $RECYCLE.BIN — Windows/SMB-client artifacts that show up on samba-share-backed PVCs.
  • @eaDir — Synology NAS extended-attribute/thumbnail metadata junk.
  • .snapshot — NAS-exposed snapshot pseudo-directories (NetApp-style). Deliberately unanchored (no leading /): these appear at every level of a NetApp-backed export, not just the root, and backing one up recursively would multiply the backup size by re-capturing older snapshot generations as regular file data. Flip side: a legitimate directory named .snapshot at any depth is also excluded — set ignoreRules explicitly if you have one (your list replaces the default).

A named fn so it backs BOTH #[serde(default = ...)] (the common case: an absent files: block, handled by the controller glue in kopiur_mover::workspec since the apiserver only server-side-defaults NESTED fields when the parent object is present) AND #[schemars(default = ...)] (so the default is visible in the generated CRD schema / kubectl explain, and applies when files: {} is present without ignoreRules). ONE source of truth for both layers.