Skip to main content
added 34 characters in body
Source Link
ceremcem
  • 2.5k
  • 1
  • 30
  • 61

btrfs sub snap foo bar creates an exact same contents of subvolume foo as subvolume bar, except the subvolumes in foo, which are excluded in bar.

What I want is excluding some regular folders too from the output (bar), such as node_modules and tmp; just like rsync --exclude ... does.

There are several ways to make this happen, for example:

  • Create a subvolume for the folderseach folder that is to be excluded. (Con: automatically generated folders can not be excluded as they are created as regular folders, such as node_modules within this approachscenario)
  • Create a temporary subvolume, delete the unwanted files/folders (Most promising approach), then create the final subvolume from it.

Other than above, can we apply a programmatic filter while creating snapshots?

btrfs sub snap foo bar creates an exact same contents of subvolume foo as subvolume bar, except the subvolumes in foo, which are excluded in bar.

What I want is excluding some regular folders too from the output (bar), such as node_modules and tmp; just like rsync --exclude ....

There are several ways to make this happen, for example:

  • Create a subvolume for the folders to be excluded. (Con: automatically generated folders can not be excluded as they are created regular folders, such as node_modules with this approach)
  • Create a temporary subvolume, delete unwanted files/folders (Most promising approach)

Other than above, can we apply a programmatic filter while creating snapshots?

btrfs sub snap foo bar creates an exact same contents of subvolume foo as subvolume bar, except the subvolumes in foo.

What I want is excluding some regular folders too from the output (bar), such as node_modules and tmp; just like rsync --exclude ... does.

There are several ways to make this happen, for example:

  • Create a subvolume for the each folder that is to be excluded. (Con: automatically generated folders can not be excluded as they are created as regular folders, such as node_modules in this scenario)
  • Create a temporary subvolume, delete the unwanted files/folders (Most promising approach), then create the final subvolume from it.

Other than above, can we apply a programmatic filter while creating snapshots?

Source Link
ceremcem
  • 2.5k
  • 1
  • 30
  • 61

Anyway to apply filter while btrfs subvolume snapshotting?

btrfs sub snap foo bar creates an exact same contents of subvolume foo as subvolume bar, except the subvolumes in foo, which are excluded in bar.

What I want is excluding some regular folders too from the output (bar), such as node_modules and tmp; just like rsync --exclude ....

There are several ways to make this happen, for example:

  • Create a subvolume for the folders to be excluded. (Con: automatically generated folders can not be excluded as they are created regular folders, such as node_modules with this approach)
  • Create a temporary subvolume, delete unwanted files/folders (Most promising approach)

Other than above, can we apply a programmatic filter while creating snapshots?