sanoid icon indicating copy to clipboard operation
sanoid copied to clipboard

exclude parent datasets recursivly

Open eoli3n opened this issue 2 years ago • 0 comments

I have multiple children in jails dataset.

root@nas ~# zfs list -r zroot/bastille/jails
NAME                                  USED  AVAIL     REFER  MOUNTPOINT
zroot/bastille/jails                 3.37G   213G      112K  /usr/local/bastille/jails
zroot/bastille/jails/jekyll          1.17G   213G      112K  /usr/local/bastille/jails/jekyll
zroot/bastille/jails/jekyll/root     1.17G   213G      905M  /usr/local/bastille/jails/jekyll/root
zroot/bastille/jails/nginx            480M   213G      120K  /usr/local/bastille/jails/nginx
zroot/bastille/jails/nginx/root       480M   213G      246M  /usr/local/bastille/jails/nginx/root

I snapshot them with that config, to not have to declare them explicitly. sanoid.conf

[zroot/bastille/jails]
    recursive = yes
    process_children_only = yes
    autosnap = yes
    autoprune = yes
    frequently = 0
    hourly = 24
    daily = 30
    monthly = 12
    yearly = 0

For each child, it creates snapshots for parent dataset jekyll AND child jekyll/root.

root@nas ~# zfs list -rt snapshot zroot/bastille/jails/jekyll
NAME                                                                    USED  AVAIL     REFER  MOUNTPOINT
zroot/bastille/jails/jekyll@autosnap_2021-12-28_20:00:00_hourly           0B      -      112K  -
zroot/bastille/jails/jekyll@autosnap_2021-12-28_21:00:00_hourly           0B      -      112K  -
zroot/bastille/jails/jekyll@autosnap_2021-12-28_22:00:00_hourly           0B      -      112K  -
zroot/bastille/jails/jekyll/root@autosnap_2021-12-28_20:00:00_hourly    268K      -      905M  -
zroot/bastille/jails/jekyll/root@autosnap_2021-12-28_21:00:00_hourly    268K      -      905M  -
zroot/bastille/jails/jekyll/root@autosnap_2021-12-28_22:00:00_hourly    276K      -      905M  -

I want to create snapshots only for */root datasets and not create parents which are empty. As we cannot use wildcards, how to exclude them ? A kind of

[zroot/bastille/jails/*]
    autosnap = no
    autoprune = no

Related : https://github.com/jimsalterjrs/sanoid/issues/512

eoli3n avatar Dec 28 '21 22:12 eoli3n