Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snapshots always recursive? #83

Open
DashFE opened this issue Mar 25, 2018 · 1 comment · Fixed by daniel-ayers/zfs-auto-snapshot#1 or GrayXu/zfs-auto-snapshot#1 · May be fixed by #124
Open

Snapshots always recursive? #83

DashFE opened this issue Mar 25, 2018 · 1 comment · Fixed by daniel-ayers/zfs-auto-snapshot#1 or GrayXu/zfs-auto-snapshot#1 · May be fixed by #124

Comments

@DashFE
Copy link

DashFE commented Mar 25, 2018

Hello,
Am I doing something wrong or does "zfs-auto-snapshot" always make recursive snapshots?

I happen to have a usecase for non recursiv snapshots and would love to use zfs-auto-snapshot for it.

Initially found on Debian Stretch with zfs-auto-snapshot Package from apt (v1.2.1-1)
Tested with Debian Stretch with zfs-auto-snapshot install from git

root@BF-GW:~# zfs-auto-snapshot --debug -v --keep=3 --label=test storage1/test Debug: Including storage1/test for recursive snapshot. Doing recursive snapshots of storage1/test Destroying all but the newest 3 snapshots of each dataset. Debug: zfs snapshot -o com.sun:auto-snapshot-desc='-' -r 'storage1/test@zfs-auto-snap_test-2018-03-25-1822' @zfs-auto-snap_test-2018-03-25-1822, 1 created, 0 destroyed, 0 warnings.

Thank you in advance

@copyrights
Copy link

I'm just run into same question and here are my findings.

To have non-recursive snapshots you have to set the user-property com.sun:auto-snapshot or com.sun:auto-snapshot:"$opt_label" on your zfs.

Then you have the option to recursively include every descendant that is not set to false (default behavior) or only snapshot filesystem or volumes that are set to true (--default-exclude)

Unfortunately zfs set com.sun:auto-snapshot=true storage1/test applies the property recursively to all descendants (at least on my system). And the property is inherited. That mean every new descendant will be true.

jigpu added a commit to jigpu/zfs-auto-snapshot that referenced this issue Apr 23, 2021
The program currently stores all targets into `TARGETS_RECURSIVE` even
if the `--recursive` flag is not set. This causes the program to
incorrectly snapshot only the most-ancestral datasets in the list. For
example, the following invocation would only snapshot datasets `a` and
`b`:

    $ zfs-snapshot-auto a a\child1 a\child2 b b\child1 b\child2

Instead, we should be storing each valid dataset in `TARGETS_REGULAR`
so that they can be backed up individually. This commit tests wether
the flag is set before deciding whih variable to update.

Fixes: zfsonlinux#83
jigpu added a commit to jigpu/zfs-auto-snapshot that referenced this issue Apr 23, 2021
The program currently stores all targets into `TARGETS_RECURSIVE` even
if the `--recursive` flag is not set. This causes the program to
incorrectly snapshot only the most-ancestral datasets in the list. For
example, the following invocation would only snapshot datasets `a` and
`b`:

    $ zfs-snapshot-auto a a\child1 a\child2 b b\child1 b\child2

Instead, we should be storing each valid dataset in `TARGETS_REGULAR`
so that they can be backed up individually. This commit tests wether
the flag is set before deciding whih variable to update.

Fixes: zfsonlinux#83
@jigpu jigpu linked a pull request Dec 9, 2021 that will close this issue
Guiorgy pushed a commit to Guiorgy/zfs-auto-snapshot that referenced this issue Aug 23, 2024
The program currently stores all targets into `TARGETS_RECURSIVE` even
if the `--recursive` flag is not set. This causes the program to
incorrectly snapshot only the most-ancestral datasets in the list. For
example, the following invocation would only snapshot datasets `a` and
`b`:

    $ zfs-snapshot-auto a a\child1 a\child2 b b\child1 b\child2

Instead, we should be storing each valid dataset in `TARGETS_REGULAR`
so that they can be backed up individually. This commit tests wether
the flag is set before deciding whih variable to update.

Fixes: zfsonlinux#83
Guiorgy pushed a commit to Guiorgy/zfs-auto-snapshot that referenced this issue Aug 23, 2024
The program currently stores all targets into `TARGETS_RECURSIVE` even
if the `--recursive` flag is not set. This causes the program to
incorrectly snapshot only the most-ancestral datasets in the list. For
example, the following invocation would only snapshot datasets `a` and
`b`:

    $ zfs-snapshot-auto a a\child1 a\child2 b b\child1 b\child2

Instead, we should be storing each valid dataset in `TARGETS_REGULAR`
so that they can be backed up individually. This commit tests wether
the flag is set before deciding whih variable to update.

Fixes: zfsonlinux#83
Guiorgy pushed a commit to Guiorgy/zfs-auto-snapshot that referenced this issue Aug 24, 2024
The program currently stores all targets into `TARGETS_RECURSIVE` even
if the `--recursive` flag is not set. This causes the program to
incorrectly snapshot only the most-ancestral datasets in the list. For
example, the following invocation would only snapshot datasets `a` and
`b`:

    $ zfs-snapshot-auto a a\child1 a\child2 b b\child1 b\child2

Instead, we should be storing each valid dataset in `TARGETS_REGULAR`
so that they can be backed up individually. This commit tests wether
the flag is set before deciding whih variable to update.

Fixes: zfsonlinux#83
Guiorgy pushed a commit to Guiorgy/zfs-auto-snapshot that referenced this issue Aug 24, 2024
The program currently stores all targets into `TARGETS_RECURSIVE` even
if the `--recursive` flag is not set. This causes the program to
incorrectly snapshot only the most-ancestral datasets in the list. For
example, the following invocation would only snapshot datasets `a` and
`b`:

    $ zfs-snapshot-auto a a\child1 a\child2 b b\child1 b\child2

Instead, we should be storing each valid dataset in `TARGETS_REGULAR`
so that they can be backed up individually. This commit tests wether
the flag is set before deciding whih variable to update.

Fixes: zfsonlinux#83
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment